{"id":3453,"date":"2021-07-05T11:58:16","date_gmt":"2021-07-05T18:58:16","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=3453"},"modified":"2021-07-05T11:58:18","modified_gmt":"2021-07-05T18:58:18","slug":"how-to-vlookup-numbers-stored-as-text-in-excel","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=3453","title":{"rendered":"How To Vlookup Numbers Stored As Text In Excel?"},"content":{"rendered":"\n<h5 class=\"wp-block-heading\" id=\"page-title\">VLOOKUP with numbers and text<\/h5>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/exceljet.net\/sites\/default\/files\/styles\/function_screen\/public\/images\/formulas\/VLOOKUP%20with%20numbers%20and%20text%20solution.png?itok=dGze1U3i\" alt=\"Excel formula: VLOOKUP with numbers and text\" title=\"Excel formula: VLOOKUP with numbers and text\"\/><\/figure>\n\n\n\n<p>Generic formula&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">=<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-vlookup-function\">VLOOKUP<\/a>(val&amp;\"\",table,col,0)<\/pre>\n\n\n\n<p>Summary&nbsp;<\/p>\n\n\n\n<p>To use the&nbsp;<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-vlookup-function\">VLOOKUP function<\/a>&nbsp;to retrieve information from a table where the key values are numbers stored as text,&nbsp; you can use a formula that&nbsp;<a href=\"https:\/\/exceljet.net\/glossary\/concatenation\">concatenates<\/a>&nbsp;an&nbsp;<a href=\"https:\/\/exceljet.net\/glossary\/empty-string\">empty string<\/a>&nbsp;(&#8220;&#8221;) to the numeric lookup value, coercing it to text. In the example shown, the formula in H3 is:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">=<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-vlookup-function\">VLOOKUP<\/a>(id&amp;\"\",planets,2,0) \/\/ returns \"Earth\"<\/pre>\n\n\n\n<p>where&nbsp;<strong>id<\/strong>&nbsp;(H2) and&nbsp;<strong>planets<\/strong>&nbsp;(B3:B11) are&nbsp;<a href=\"https:\/\/exceljet.net\/glossary\/named-range\">named ranges<\/a>.&nbsp;<\/p>\n\n\n\n<p><em>Note:&nbsp;The example is a&nbsp;<u>workaround<\/u>&nbsp;to the problem of mismatched numbers and text, which cause a #N\/A error. If there is no mismatch, the workaround is not necessary and you can use a&nbsp;<a href=\"https:\/\/exceljet.net\/lessons\/how-to-use-vlookup\">normal VLOOKUP formula<\/a>.<\/em>https:\/\/imasdk.googleapis.com\/js\/core\/bridge3.470.1_en.html#goog_62510261512.6MExplanation&nbsp;<\/p>\n\n\n\n<p>A common VLOOKUP error is a mismatch between numbers and text. Most typically,&nbsp; the lookup&nbsp;column in the table contains numeric values&nbsp;<em>that look like numbers<\/em>, but are in fact&nbsp;<em>numbers stored as text<\/em>. When a genuine number is passed into VLOOKUP as the first argument, the formula returns a #N\/A error,&nbsp;even though&nbsp;there appears to be a match. The screen below shows an example of this problem:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/exceljet.net\/sites\/default\/files\/styles\/original_with_watermark\/public\/images\/formulas\/inline\/VLOOKUP%20with%20numbers%20and%20text%20problem.png?itok=GFbI1DZb\" alt=\"Example of VLOOKUP error with numbers and text mismatch\" title=\"Example of VLOOKUP error with numbers and text mismatch\"\/><\/figure>\n\n\n\n<p><em>The numbers in column B are actually text, so the numeric lookup value, 3, fails, even though it seems like VLOOKUP should match B5 and return &#8220;Earth&#8221;. You can enter a number as a&nbsp;<a href=\"https:\/\/exceljet.net\/glossary\/text-value\">text value<\/a>&nbsp;by preceding the number with a single quote (&#8216;).<\/em><\/p>\n\n\n\n<p>The best solution is to make sure the lookup values in the table are indeed numbers.&nbsp;However, if you don&#8217;t have control over the table, you can modify the VLOOKUP formula to coerce the lookup value to match the type in the table. In the example shown, we coerce the numeric lookup value to text by&nbsp;<a href=\"https:\/\/exceljet.net\/glossary\/concatenation\">concatenating<\/a>&nbsp;an&nbsp;<a href=\"https:\/\/exceljet.net\/glossary\/empty-string\">empty string<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">=<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-vlookup-function\">VLOOKUP<\/a>(id,planets,2,0)    \/\/ original\n=<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-vlookup-function\">VLOOKUP<\/a>(id&amp;\"\",planets,2,0) \/\/ revised<\/pre>\n\n\n\n<p>And the revised formula takes care of the error:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/exceljet.net\/sites\/default\/files\/styles\/original_with_watermark\/public\/images\/formulas\/inline\/VLOOKUP%20with%20numbers%20and%20text%20solution.png?itok=BCpcys_N\" alt=\" VLOOKUP numbers and text error solution\" title=\" VLOOKUP numbers and text error solution\"\/><\/figure>\n\n\n\n<p>You could also do the same thing with a longer formula that utilizes the<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-text-function\">&nbsp;TEXT function<\/a>&nbsp;to convert the number&nbsp;to text:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">=<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-vlookup-function\">VLOOKUP<\/a>(<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-text-function\">TEXT<\/a>(id,\"@\"),planets,2,0)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Both numbers and text<\/h3>\n\n\n\n<p>If you can&#8217;t be certain when you&#8217;ll have numbers and when you&#8217;ll have text, you can cater to both options by wrapping VLOOKUP in the&nbsp;<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-iferror-function\">IFERROR function<\/a>&nbsp;and using a formula that handles both cases:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">=<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-iferror-function\">IFERROR<\/a>(<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-vlookup-function\">VLOOKUP<\/a>(id,planets,3,0),<a href=\"https:\/\/exceljet.net\/excel-functions\/excel-vlookup-function\">VLOOKUP<\/a>(id&amp;\"\",planets,3,0))<\/pre>\n\n\n\n<p>Here, we first try a normal VLOOKUP formula that assumes both lookup value and the first column in the tables are numbers. If that throws an error, we try again with the revised formula. If that formula also fails, VLOOKUP will return an #N\/A error as always.<\/p>\n\n\n\n<p>Ref: <\/p>\n\n\n\n<p><a href=\"https:\/\/exceljet.net\/formula\/vlookup-with-numbers-and-text\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/exceljet.net\/formula\/vlookup-with-numbers-and-text<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.extendoffice.com\/documents\/excel\/3802-excel-vlookup-numbers-stored-as-text.html\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.extendoffice.com\/documents\/excel\/3802-excel-vlookup-numbers-stored-as-text.html<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>VLOOKUP with numbers and text Generic formula&nbsp; =VLOOKUP(val&amp;&#8221;&#8221;,table,col,0) Summary&nbsp; To use the&nbsp;VLOOKUP function&nbsp;to retrieve information from a table where the key values are numbers stored as text,&nbsp; you can use a formula that&nbsp;concatenates&nbsp;an&nbsp;empty string&nbsp;(&#8220;&#8221;) to the numeric lookup value, coercing it to text. In the example shown, the formula in H3 is: =VLOOKUP(id&amp;&#8221;&#8221;,planets,2,0) \/\/ returns <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=3453\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,18],"tags":[778],"class_list":["post-3453","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-microsoft-office","tag-vlookup-numbers-stored-as-text"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3453"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3453\/revisions"}],"predecessor-version":[{"id":3454,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3453\/revisions\/3454"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}