跳到主要內容

如果單元格在Excel中為空,如何不計算(忽略公式)?

假設我們有一批學生,他們的生日在Excel中,我們需要計算學生的年齡。 通常,我們可以使用=(TODAY()-B2)/365.25的公式來計算年齡。 但是,由於有些學生的生日不是偶然發生的,所以我們變得荒謬。 為避免錯誤,如果Excel中的單元格為空白,我們不必計算或忽略公式。

如果Excel中的單元格為空,則不計算(忽略公式)
doc公式忽略空白1


如果Excel中的單元格為空,則不要計算或忽略公式

要忽略公式或不計算Excel中特定單元格是否為空白,我們需要使用IF函數檢查特定單元格是否為空白,如果不為空白,則可以繼續使用原始公式進行計算。

= IF(Specific Cell <>“”,Original Formula,“”)

在開始討論的情況下,我們需要輸入 = IF(B2 <>“”,(TODAY()-B2)/365.25,“”) 到單元格C2中,然後將“填充手柄”拖動到所需的範圍。

備註:B2表示單元格B2充滿了生日,如果單元格B2為空白,它將忽略公式並返回空白;如果單元格B2充滿了生日,則將返回年齡。

另外,我們也可以將IF函數和原始公式組合為 = IF(Specific Cell =“”,“”,“原始公式”),在本例中,公式顯示為 = IF(B2 =“”,“”,(TODAY()-B2)/365.25).


演示:如果Excel中的單元格為空,則不計算(忽略公式)


Excel的Kutools:超過 300 個方便的工具觸手可及! 立即開始 30 天免費試用,沒有任何功能限制。 現在就下載!

在Excel中選擇的所有空白單元格中快速輸入破折號,某些文本或NA

Kutools for Excel的 填寫空白單元格 實用程序可以幫助您僅在Excel中單擊幾下,即可將選定的文本(例如“警告”)快速輸入到選定範圍內的所有空白單元格中。


廣告填充空白單元格5


箭頭藍色右氣泡相關文章

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Bagaimana rumus if bertingkat untuk kondisi seperti ini

Jika kolom notes terisi maka tetap meet SLA

Jika kolom notes kosong maka,
Jika kolom Days = 1 maka meet
Jika lebih dari dari itu maka miss
jika kosong maka NO CRF
This comment was minimized by the moderator on the site
FYI for Calculating due dates:
=IF(A1<>””,A1+7,””)
A1:1/1/21 would return 1/8/21
This comment was minimized by the moderator on the site
I am trying to return the earliest date in a range of dates in 6 columns based on the value of another column If I were to say it out loud it would be:
If M6:M603 equals 1, then identify the minimum date in the following columns G6:L603 but do not count the value if the cell is blank and insert this into another sheet on the workbook. I get very close but it keeps returning the date 00/01/1900. Can anyone help?
This comment was minimized by the moderator on the site
How to calculate Non Empty cells that contains formula?
This comment was minimized by the moderator on the site
Hi Aamir.Ali002,
You can find out the cells which are formula cells and return blank with a formula. Says the first cell is H2, and apply this formula =IF(AND(E2=0,ISFORMULA(E2)=TRUE),1,0), and then drag the cell handle to copy this formula to other cells.
Then sum the formula cells to get the total number of cells which are formula cells and return blank.
This comment was minimized by the moderator on the site
Finally worked out how to count a complex range of conditions over an extended period of time but only if the date of the events is not blank with this:
=IF($B608<>"",(COUNTIF($O$6:$O608,Q$5)),"")
In other words, "count apples or oranges but not if column B (dates) is blank".
THANK YOU, it has been bugging me for weeks to get this so I can make a chart from a date in the past to infinity (so as not to have to keep adjusting the chart range each day as data is entered
This comment was minimized by the moderator on the site
how about in months?
This comment was minimized by the moderator on the site
Hi israelroy,
Would you describe your problems in detail? More information will help us understand your problem clear. Thank you!
This comment was minimized by the moderator on the site
thank for share
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations