跳到主要內容

如何在Excel中以文本形式存儲vlookup數字?

假設我有以下數據范圍,原始表中的ID號是數字格式,在存儲為文本的查找單元格中,當我應用正常的VLOOKUP函數時,將得到一個錯誤結果,如下圖所示。 在這種情況下,如果表中的查找號和原始號具有不同的數據格式,如何獲得正確的信息?

Vlookup數字存儲為帶有公式的文本

doc vlookup號存儲為文本1


箭頭藍色右氣泡 Vlookup數字存儲為帶有公式的文本

如果您的查詢號碼以文本形式存儲,並且表中的原始號碼為實數格式,請應用以下公式返回正確的結果:

輸入以下公式: = VLOOKUP(VALUE(G1),A2:D15,2,FALSE) 放入要查找結果的空白單元格,然後按 Enter 鍵返回您需要的相應信息,請參見屏幕截圖:

doc vlookup號存儲為文本2

筆記:

1.在上式中: G1 是您要查找的條件, A2:D15 是包含您要使用的數據和數字的表範圍 2 表示具有要返回的相應值的列號。

2.如果您的查找值為數字格式,並且原始表中的ID號以文本形式存儲,則上述公式將不起作用,您應應用以下公式: = VLOOKUP(TEXT(G1,0),A2:D15,2,FALSE) 以獲得所需的正確結果。

doc vlookup號存儲為文本3

3.如果不確定何時會有數字和何時有文字,可以使用以下公式: =IFERROR(VLOOKUP(VALUE(G1),A2:D15,2,0),VLOOKUP(TEXT(G1,0),A2:D15,2,0)) 處理這兩種情況。

最佳辦公生產力工具

🤖 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 (13)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Worked. Thank you! 
This comment was minimized by the moderator on the site
Hello,
You are welcome. Glad it helps. Any questions, please feel free to contact us. Have a great day.
Sincerely,
Mandy
This comment was minimized by the moderator on the site
Thanks so much!!!!! This worked for me, the #3 solution! HUGE help!!!
This comment was minimized by the moderator on the site
Hello,
You are welcome. Glad it helps. Any questions, please feel free to contact us. Have a great day.
Sincerely,
Mandy
This comment was minimized by the moderator on the site
Thank You... :) Its worked for me
This comment was minimized by the moderator on the site
Hello,
You are welcome. Glad it helps. Any questions, please feel free to contact us. Have a great day.
Sincerely,
Mandy
This comment was minimized by the moderator on the site
Same thing here. The problem is the data range. For some reason, even when the data type is text, MS Excel still looks at it as a number. But if you hit enter, it looks at it as text. So I usually end up with the data range where some of it is numbers and others, text.

SOLUTION: Use IFERROR function to address BOTH possibilities: IFERROR(VLOOKUP(TEXT(A1,0),$A$1:$A$100,1,FALSE),VLOOKUP(VALUE(A1),$A$1:$A$100,1,FALSE)). Hope this helps.
This comment was minimized by the moderator on the site
Unfortunately this method does not Always work. I import numbers in a column defined as tekst. I lookup these numbers in a table in which the numbers are also stored as tekst. I would say a Vlookup should work, but nor the standard lookup, nor the lookup with TEXT() or VALUE() function as expected. When I retype all values in the columns it works as expected, so there's no error in the formula.
This comment was minimized by the moderator on the site
I have the same problem @Rens, does anybody know a solution for this?
This comment was minimized by the moderator on the site
Same thing here. The problem is the data range. For some reason, even when the data type is text, MS Excel still looks at it as a number. But if you hit enter, it looks at it as text. So I usually end up with the data range where some of it is numbers and others, text.

SOLUTION: Use IFERROR function to address BOTH possibilities: IFERROR(VLOOKUP(TEXT(A1,0),$A$1:$A$100,1,FALSE),VLOOKUP(VALUE(A1),$A$1:$A$100,1,FALSE)). Hope this helps.
This comment was minimized by the moderator on the site
This is what I do and is perfect.
This comment was minimized by the moderator on the site
Same thing here. The problem is the data range. For some reason, even when data type is text, it looks like it's still looked on as a number. But if you hit enter, it looks at it as text. So I usually would end up with the data range where some of it is numbers and others text.

SOLUTION: Use IFERROR function to address BOTH possibilities: IFERROR(VLOOKUP(TEXT(A1,0),$A$1:$A$100,1,FALSE),VLOOKUP(VALUE(A1),$A$1:$A$100,1,FALSE)). Hope this helps.
This comment was minimized by the moderator on the site
Hello Jaji, thanks, this works, I hope in all cases. Nevertheless it looks like a bug to me.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations