{"id":31648,"date":"2021-02-17T19:33:36","date_gmt":"2021-02-17T18:33:36","guid":{"rendered":"https:\/\/blog.sheetgo.com\/?p=31648"},"modified":"2021-02-17T19:33:36","modified_gmt":"2021-02-17T18:33:36","slug":"funcao-de-pesquisa-do-excel","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/pt\/blog\/excel-functions\/lookup-function-excel\/","title":{"rendered":"Como usar a fun\u00e7\u00e3o LOOKUP no Excel"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; module_class=&#8221;sheetgo-post&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_row _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>A common task in Excel is searching your spreadsheet for certain values, and using a function to do this and return a corresponding value can be very useful. The\u00a0<a href=\"https:\/\/support.microsoft.com\/en-us\/office\/lookup-function-446d94af-663b-451d-8251-369d5e3864cb\" target=\"_blank\" rel=\"noopener noreferrer\">LOOKUP<\/a>\u00a0function in Excel is one way to do this. While the VLOOKUP and HLOOKUP functions are more powerful, the LOOKUP function is great for quick and simple lookups to keep your spreadsheet running smoothly.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Syntax<\/h3>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The LOOKUP function has two forms: vector form and array form.<\/p>\n<h4>Vector form<\/h4>\n<p>This is the form of the function that you\u2019ll typically use. You specify the lookup value and the search and results vectors, and the function will find the best match.>\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]=LOOKUP(lookup_value, lookup_vector, [result_vector])[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<ul>\n<li><b>lookup_value<\/b> is the item you are searching for\n<li><b>lookup_vector<\/b> is the range you want to search in. This can only be one column or row\n<li><b>result_vector<\/b> is an optional input. It\u2019s the range you want to get the result from<\/li>\n<\/ul>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>Array form<\/h4>\n<p>This form is less common but can be just as useful.<\/p>\n<p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.16&#8243; border_width_left=&#8221;4px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]=LOOKUP(lookup_value, array)[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<ul>\n<li><b>lookup_value<\/b> is the item you are searching for\n<li><b>array<\/b> is the range you want to search and find the result from. It will search the first column\/row for the lookup_value and pull the answer from the last column\/row<\/li>\n<\/ul>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>How to use the LOOKUP function in Excel<\/h3>\n<p>Now that you\u2019ve seen the syntax, I\u2019ll show some examples of the Excel LOOKUP function in action.<\/p>\n<p>I\u2019ll start with the vector form since this is the most common. Here I have some data from a department store, and I\u2019m using the function to find Frank\u2019s department.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/1.-LOOKUP-vector-form.png&#8221; alt=&#8221;lookup function excel vector form 1&#8243; title_text=&#8221;1. LOOKUP vector form&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; width=&#8221;640px&#8221; max_width=&#8221;640px&#8221; height=&#8221;440px&#8221; max_height=&#8221;440px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>I enter \u201cFrank\u201d as the search key, and tell the function to search in A2:A12. I also instruct the function to return the corresponding answer from B2:B12.<\/p>\n<p>I do this with the formula <b>=LOOKUP(&#8220;Frank&#8221;,A2:A12,B2:B12)<\/b>. <\/p>\n<p>Note that the two vectors are the same length \u2013 if they aren\u2019t, you\u2019ll get an error!<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>Unsorted data<\/h4>\n<p>When you use the LOOKUP Excel function, your data needs to be sorted in ascending order. The LOOKUP function provides an approximate match to your search value when there\u2019s no exact match.<\/p>\n<p>To do this, it needs sorted data. In this example, I demonstrate what happens when the data is not sorted.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/2.-LOOKUP-unsorted.png&#8221; alt=&#8221;lookup function excel unsorted 2&#8243; title_text=&#8221;2. LOOKUP unsorted&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; width=&#8221;640px&#8221; max_width=&#8221;640px&#8221; height=&#8221;440px&#8221; max_height=&#8221;440px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Here, I\u2019m searching for the person with sales closest to $8,000. By typing <b>=LOOKUP(8000,A2:A12,C2:C12)<\/b> I can make the LOOKUP function do just that.<\/p>\n<p>But you can see here that the answer is wrong. The reason for that is my data isn\u2019t sorted, so the function can\u2019t tell what the right answer is!<\/p>\n<p>I can fix that problem by sorting the data by sales in ascending order. Now I get the correct answer!<\/p>\n<p>Note that the LOOKUP function will always return the value lower than the search value when there\u2019s no exact match. Even if Isaiah had $8,001 in sales, it would still return Emily because she\u2019s the closest to $8,000 without surpassing it!\n<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/3.-LOOKUP-sorted.png&#8221; alt=&#8221;lookup function excel sorted 3&#8243; title_text=&#8221;3. LOOKUP sorted&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; width=&#8221;640px&#8221; max_width=&#8221;640px&#8221; height=&#8221;440px&#8221; max_height=&#8221;440px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>Array format<\/h4>\n<p>You\u2019ve now seen how the LOOKUP function in Excel works in vector format. As I mentioned previously, that\u2019s the more common format.<\/p>\n<p>But you also have the option of using array format. The difference here is you only need to specify a lookup_value and a single array.<\/p>\n<p>In the example below, I find Greg\u2019s sales using the formula <b>=LOOKUP(&#8220;Greg&#8221;,A2:C12)<\/b>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/02\/4.-LOOKUP-array-form.png&#8221; alt=&#8221;lookup function excel array form 4&#8243; title_text=&#8221;4. LOOKUP array form&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; width=&#8221;640px&#8221; max_width=&#8221;640px&#8221; height=&#8221;440px&#8221; max_height=&#8221;440px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The benefit of the array format is you only have to specify one array, instead of two separate vectors.<\/p>\n<p>The function will automatically search the first column (or row if it\u2019s a horizontal array) for the lookup_value and return the result from the last column (or row).<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Tips for using the Excel LOOKUP function<\/h3>\n<ul>\n<li>The LOOKUP function automatically searches for approximate matches. Unlike the VLOOKUP or HLOOKUP functions, you can\u2019t specify an exact match<\/li>\n<li>The data must be sorted in ascending order, otherwise you\u2019ll get incorrect results<\/li>\n<li>It will always return a value smaller or equal to the <b>lookup_value<\/b>, never larger. This is true even if a larger value is closer to the lookup_value than the smaller value<\/li>\n<li>The <a href=\"https:\/\/www.sheetgo.com\/blog\/excel-functions\/vlookup-excel\/\">VLOOKUP<\/a> (vertical lookup) and HLOOKUP (horizontal lookup) functions are more versatile and useful versions of LOOKUP<\/li>\n<li>LOOKUP is not case-sensitive<\/li>\n<\/ul>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A common task in Excel is searching your spreadsheet for certain values, and using a function to do this and return a corresponding value can be very useful. The\u00a0LOOKUP\u00a0function in Excel is one way to do this. While the VLOOKUP and HLOOKUP functions are more powerful, the LOOKUP function is great for quick and simple [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":31691,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[65],"tags":[39,48,28],"class_list":["post-31648","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel-functions","tag-connections-t","tag-excel","tag-spreadsheets"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/31648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/comments?post=31648"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/31648\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media\/31691"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media?parent=31648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/categories?post=31648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/tags?post=31648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}