跳到主要內容

如何在Excel中使用vlookup返回空白或特定值而不是0或N / A?

通常,當您應用vlookup函數返回相應的值時,如果匹配的單元格為空,則將返回0,如果找不到匹配的值,則會顯示錯誤#N / A值,如下圖所示。 而不是顯示0或#N / A值,如何使其顯示空白單元格或其他特定的文本值?

匹配的單元格為空白:顯示0 找不到匹配的值:顯示N / A值

Vlookup返回空白或特定值而不是公式的0

Vlookup返回空白或特定值,而不是公式不適用

Vlookup通過強大的功能返回空白或特定值,而不是0或N / A


Vlookup返回空白或特定值而不是公式的0

請將此公式輸入到您需要的空白單元格中:

=IF(LEN(VLOOKUP(D2,A2:B10,2,0))=0,"",VLOOKUP(D2,A2:B10,2,0))

然後按 Enter 鍵,您將獲得一個空白單元格而不是0,請參見屏幕截圖:

筆記:

1.在上式中 D2 是您要返回其相對值的條件, A2:B10 是您使用的數據范圍,數字 2 指示返回匹配值的列。

2.如果要返回特定的文本而不是0值,則可以應用以下公式: = IF(LEN(VLOOKUP(D2,A2:B10,2,0))= 0,“具體文字“,VLOOKUP(D2,A2:B10,2,0))。


Vlookup在Excel中返回空白或特定值而不是0或N / A錯誤值

Excel的Kutools's 將0或#N / A替換為空白或特定值 如果vlookup結果為0或#N / A值,該實用程序可幫助您返回並顯示空白單元格或特定值。 點擊下載Kutools for Excel!

Excel的Kutools:擁有 300 多個方便的 Excel 插件,30 天內免費試用,無限制。 立即下載並免費試用!


Vlookup返回空白或特定值,而不是公式不適用

如果找不到您要查找的值,則用空白單元格或其他自定義值替換#N / A錯誤,可以使用以下公式:

=IFERROR(VLOOKUP(D2,A2:B10,2,FALSE),"")

然後,按 Enter 獲得所需結果的關鍵,請參見屏幕截圖:

筆記:

1.在這個公式中 D2 是您要返回其相對值的條件, A2:B10 您使用的數據范圍,數字 2 指示返回匹配值的列。

2.如果要返回特定的文本而不是#N / A值,則可以應用以下公式: = IFERROR(VLOOKUP(D2,A2:B10,2,FALSE),“具體文字“)。


Vlookup通過強大的功能返回空白或特定值,而不是0或N / A

如果你有 Excel的Kutools,其 將0或#N / A替換為空白或特定值 功能,您可以快速輕鬆地解決此任務。

提示:要應用此 將0或#N / A替換為空白或特定值 功能,首先,您應該下載 Excel的Kutools,然後快速輕鬆地應用該功能。

安裝後 Excel的Kutools,請這樣做:

1。 點擊 庫工具 > 超級查詢 > 將0或#N / A替換為空白或特定值,請參見屏幕截圖:

2。 在 將0或#N / A替換為空白或特定值 對話框:

  • (1.)根據需要指定查找值和輸出範圍;
  • (2.)根據需要選擇返回結果,可以選擇 將0或#N / A值替換為空 選項或 將0或#N / A值替換為指定的值 選項;
  • (3.)選擇數據范圍以及相應的鍵和返回的列。

3。 然後,點擊 OK 按鈕,將顯示您在步驟2中指定的特定值,而不是0或#N / A錯誤值,請參見屏幕截圖:

點擊下載Kutools for Excel並立即免費試用!


更多相關文章:

  • 跨多個工作表的Vlookup值
  • 在excel中,我們可以輕鬆地應用vlookup函數在工作表的單個表中返回匹配值。 但是,您是否曾經考慮過如何在多個工作表中實現vlookup價值? 假設我有以下三個具有數據范圍的工作表,現在,我想根據這三個工作表中的條件來獲取相應值的一部分。
  • Vlookup並返回兩個值之間的匹配數據
  • 在Excel中,我們可以應用常規的Vlookup函數基於給定的數據獲取相應的值。 但是,有時,我們想要vlookup並返回兩個值之間的匹配值,您如何在Excel中處理此任務?
  • Vlookup並從下拉列表中返回多個值
  • 在Excel中,如何從下拉列表中進行vlookup並返回多個相應的值,這意味著當您從下拉列表中選擇一項時,其所有相對值會立即顯示,如以下屏幕截圖所示。 本文,我將逐步介紹解決方案。
  • 跨多個工作表的Vlookup值以返回工作表名稱
  • 假設我有多個工作表,每個工作表都包含一個名稱列表,現在,我要在主工作表中查找名稱,並返回名稱所在的匹配工作表名稱,如下面的屏幕快照所示。 您如何在Excel中解決此任務?
  • Vlookup並返回沒有重複的多個值
  • 有時,您可能需要vlookup並將多個匹配的值一次返回到單個單元格中。 但是,如果在返回的單元格中填充了一些重複的值,那麼在返回所有匹配值時如何忽略重複項,而僅保留唯一值,如下面的Excel截圖所示?

最佳辦公生產力工具

🤖 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 (27)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
can i amend formula =IF(VLOOKUP($C4,Sheet2!$F:$F,1,0),"1") to display result as "1" and #N/A as blank?
This comment was minimized by the moderator on the site
Hello, eggs
To splve your problem, please apply the below formula:

=IFNA(IF(LEN(INDEX($B$2:$B$19,MATCH(E2,$A$2:$A$19,0)))=0,"1",VLOOKUP(E2,IF({1,0},$A$2:$A$19,$B$2:$B$19),2,0)),"")


Please try, hope it can help you!
This comment was minimized by the moderator on the site
is it possible to get this formula to return result as 1 and #N/A as blank?
This comment was minimized by the moderator on the site
Hi, in my vlookup im getting zero and NA now i want to format the zero and NA to blank and also to have one formula that is going to cater all the cells instead of having 3difference formulas i want the formula i use to then know if its its NA OR Zero to automatic put a blank but still reveals' the exact answer
This comment was minimized by the moderator on the site
Hello, zodwa,
To return the blank results for both the 0 values and errors, you should apply the below formula:
=IFNA(IF(LEN(INDEX($B$2:$B$12,MATCH(D2,$A$2:$A$12,0)))=0,"",VLOOKUP(D2,IF({1,0},$A$2:$A$12,$B$2:$B$12),2,0)),"")


https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-vlookup-errors-1.png

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Very helpful, thanks
This comment was minimized by the moderator on the site
I think this is a good solution but is there a way around the problem that if I use it and then COUNTA() on the cells where the formula is created it counts those cells with "".
This comment was minimized by the moderator on the site
I am not a tech guru - I just want to add to my formula that if it does not find anything in the cell - it gives an accounting 0 that will be acknowledged in my total formula. =VLOOKUP(F4,Sponsorships1,2,FALSE)
This comment was minimized by the moderator on the site
for blank values the LEN function is converting true zero's from the lookup data to blank. Any ideas on how to bring true zeros across and only convert the blanks to blank?
This comment was minimized by the moderator on the site
Hi, Besty,
The above Len function just convert blanks to blank, and it keeps the real 0 when applying it. please try it again.
Or you can insert an attachment here to describe your problem.
Thank you!
This comment was minimized by the moderator on the site
Thank you, it worked!
This comment was minimized by the moderator on the site
Thanks sky yang - This is awesome!

I applied the formula you provided and I changed the cell references but now I'm getting #N/A instead of 0 or a negative symbol.
This comment was minimized by the moderator on the site
This is my formula. I can't get results to report a "-" instead of a zero. I don't want a zero I'd like accounting format for a zero. Please help.
=IF(ISNA(VLOOKUP($A13,'All Exp Posted'!$A$1:$B$100,2,FALSE)),"0",VLOOKUP($A13,'All Exp Posted'!$A$1:$B$100,2,FALSE))
This comment was minimized by the moderator on the site
all you need to do is set the cell setting to accounting and remove the " in the last part.

=IF(ISNA(VLOOKUP($A13,'All Exp Posted'!$A$1:$B$100,2,FALSE),0)

as you can see there is no quotation mark next to the zero, because adding the quotation marks sets the value as text.
This comment was minimized by the moderator on the site
Hi, laura,

If you want to get the result "- " instead of a zero, please apply the following formula:
=IF(LEN(VLOOKUP(E1,A2:B10,2,0))=0,"-",VLOOKUP(E1,A2:B10,2,0)).

Please change the cell references to your need.
Please try it, hode it can help you!

Thank you!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations