{"id":3504,"date":"2020-12-18T09:40:35","date_gmt":"2020-12-18T08:40:35","guid":{"rendered":"https:\/\/www.sheetgo.com\/?p=3504"},"modified":"2020-12-18T09:40:35","modified_gmt":"2020-12-18T08:40:35","slug":"utilizar-la-formula-hlookup-en-google-sheets","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/es\/blog\/google-sheets-formulas\/use-hlookup-formula-google-sheets\/","title":{"rendered":"C\u00f3mo utilizar la funci\u00f3n HLOOKUP en Google Sheets"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; module_class=&#8221;sheetgo-post&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#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; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The <a href=\"https:\/\/support.google.com\/docs\/answer\/3093375?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">HLOOKUP<\/a> function is perhaps not as famous and widely used as its counterpart, <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/vlookup-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener noreferrer\">VLOOKUP<\/a> function. However, the two functions are the same, with the HLOOKUP function simply being the transposed version of VLOOKUP. It stands for \u2018Horizontal Lookup\u2019. The function searches for a key value in the first row of the input range, and returns the value of a specified cell from the column where it finds the key. It will produce an error if the key doesn\u2019t exist within the range.<\/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<h2>Syntax<\/h2>\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;]=HLOOKUP(search_key, range, index, [is_sorted])[\/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><strong>HLOOKUP(search_key, range, index, [is_sorted])<\/strong><\/p>\n<ul>\n<li><strong>search_key<\/strong> \u2013 is the value that the HLOOKUP function uses to search.<\/li>\n<li><strong>range<\/strong> \u2013 is the reference to the range of cells that we are performing a search on. Google Sheets application looks for the key in the first row of the range.<\/li>\n<li><strong>index<\/strong> \u2013 this is the row index of the cell within the range, whose value the function returns. The first row\u2019s index within the <strong>range<\/strong> is 1, the second in the\u00a0<strong>range<\/strong> is 2 and so on. For example, if we input 3 against this parameter, the HLOOKUP function returns the cell value from the third row and the column in which it finds the <strong>search_key<\/strong>.<\/li>\n<li><strong>[is_sorted]<\/strong> \u2013 is an optional parameter which is TRUE by default. This indicates whether the first row in the <strong>range<\/strong> is sorted in ascending order or not. If not, we should specify the value as FALSE.<\/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<h2>How to use HLOOKUP function<\/h2>\n<h3>Numbers in the first row<\/h3>\n<p>Let\u2019s try out a few examples. Here is a test data set with sales figures for a group of salespeople. I will answer various business case questions using HLOOKUP. You\u2019ll see how the index parameter value affects the outcome.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/HLookup-image-1-1.png&#8221; alt=&#8221;hlookup-function-google-sheets-1&#8243; title_text=&#8221;hlookup-function-google-sheets-1&#8243; 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\u2019ll choose first example here to dissect and ensure that you understand the basic use of the function.  The formula <strong>=Hlookup(11876,B1:K3,2,False)<\/strong> is used to tell the function to search for the value 11,876 within the range of cells from B1 to K3. Once it finds the value, it is instructed to return the data in the second row of the column it found the data in. The False indicates that the data is not sorted, and that you want an exact match to the search key.<\/p>\n<p>Here\u2019s an interesting thing to note in the last case (row # 11 above). The function returned an #N\/A error. Why? That is, as explained in the error description, because the $15000 sales figure does not exist in the first row. Since I specified that I want an exact match (by indicating False for the <strong>is_sorted<\/strong> parameter), it cannot return an appropriate value.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>The curious case of [is_sorted]<\/h3>\n<p>In the examples, I have chosen FALSE for the last parameter, which tells the function to find an exact match with the search key. This is typically how the HLOOKUP function is used. But what happens when you use True instead to find an approximate match?<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/HLookup-image-2-1.png&#8221; alt=&#8221;hlookup-function-google-sheets-2&#8243; title_text=&#8221;hlookup-function-google-sheets-2&#8243; 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, there are two examples where we use HLOOKUP to find the person with $12,000 of sales. The first function uses an <strong>is_sorted<\/strong> parameter of False, which tells the function to find an exact match. Because there is no salesperson with exactly $12,000 of sales, the function returns an error.<\/p>\n<p>The second example is identical except it uses True instead, which tells the function that the data is sorted and it should find an approximate match. The function then tries to find the sales number that is closest to $12,000, and returns the name of the corresponding salesperson \u2013 Finch.<\/p>\n<p>Notice that the salesperson closest to $12,000 sales is actually Gary. The HLOOKUP function finds an approximate match by finding the value that is closest but not more than the search key. It therefore returns Finch here, even though Gary is technically closer to the search key. This is an important feature to take note of, since it could impact your results when using this function!<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Here is a note from the <a href=\"https:\/\/support.google.com\/docs\/answer\/3093375?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">official documentation<\/a> of the HLOOKUP function:<\/p>\n<blockquote>\n<p>Using an incorrect sort type may cause incorrect values to be returned.<\/p>\n<\/blockquote>\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>Use case: Sorted strings in the first row<\/h3>\n<p>Now that you\u2019re getting more familiar with the function, let\u2019s try an example data set in which the first row has sorted string values, as shown below. There are two examples each for all the three cases available, but with one distinction of <strong>is_sorted<\/strong> parameter. Please observe how the HLOOKUP function is behaving.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/HLookup-image-3-1.png&#8221; alt=&#8221;hlookup-function-google-sheets-3&#8243; title_text=&#8221;hlookup-function-google-sheets-3&#8243; 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>You can see that the TRUE or FALSE value for <strong>is_sorted<\/strong> parameter doesn\u2019t really affect the behaviour when it finds the <strong>search_key<\/strong> within the first row of the range. But an interesting development happens when it doesn\u2019t find an exact match for the <strong>search_key<\/strong>. In the case of FALSE (row # 12), it was looking for an exact match. But in the case of TRUE (row # 13), it is looking for an approximate match, and instead of Greg, it returns the information for Gary. This behaviour may or may not be desirable depending on your situation!<\/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>Use case: Unsorted strings in the first row<\/h3>\n<p>The data for this case is essentially the same as that used above, except there are non-sorted strings in the first row.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/HLookup-image-4-1.png&#8221; alt=&#8221;hlookup-function-google-sheets-4&#8243; title_text=&#8221;hlookup-function-google-sheets-4&#8243; 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>Unlike the previous example, the use of TRUE and FALSE values for the fourth parameter is generating different results. Because the data is not sorted, the function cannot give an accurate approximate match. When the data is not sorted, that the results are correct only when I used FALSE for <strong>is_sorted<\/strong>.<\/p>\n<p>So, what is the bottom line?<\/p>\n<p>Never lie to Google Sheets in the is_sorted parameter \u2013 if you do, it will return the favor!<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Use case: Multiple matches in the first row<\/h3>\n<p>There will be times when you may encounter multiple instances of the same value in the first row. In the example below, Barry occurs twice. What happens if you use the HLOOKUP function in such a scenario?<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/12\/HLookup-image-5-1.png&#8221; alt=&#8221;hlookup-function-google-sheets-5&#8243; title_text=&#8221;hlookup-function-google-sheets-5&#8243; 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>You may have noticed, it picks the first Barry it encounters in the list, and doesn\u2019t consider the second Barry.<\/p>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Connections B &#8211; Merge, split, filter &#8211; Vertical&#8221; module_class=&#8221;sheetgo-post-no-shadow-img md2-contained-button vertical-banner-container&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; text_font=&#8221;||||||||&#8221; background_color=&#8221;#f2f7ff&#8221; max_width=&#8221;700px&#8221; module_alignment=&#8221;center&#8221; max_height=&#8221;300px&#8221; custom_margin=&#8221;20px|0px|20px|0px|true|true&#8221; custom_padding=&#8221;25px|25px|25px|25px|true|true&#8221; sticky_limit_bottom=&#8221;section&#8221; border_radii=&#8221;on|20px|20px|20px|20px&#8221; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#d9e7ff&#8221; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221; global_module=&#8221;50477&#8243; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/connections-top-processors-main.webp\" width=\"250\" height=\"168\" alt=\"\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/Recommended-for-Google-Workspace-badge.webp\" width=\"150\" height=\"180\" alt=\"39\" \/><\/p>\n<p><span style=\"font-size: 22px; font-weight: 600;\">Merge, split, and filter spreadsheets<\/span><br \/><span style=\"color: #878d91; font-size: 18px; font-weight: 600;\">Regardless of the file format, Sheetgo can handle it.<\/span><\/p>\n<p><a href=\"https:\/\/workspace.google.com\/marketplace\/app\/sheetgo\/94172092257\" target=\"_blank\" rel=\"noopener\"><br \/><img decoding=\"async\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/09\/available-on-google-workspace-button-text.webp\" width=\"180\" height=\"\" alt=\"\" \/><br \/><\/a><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Drawbacks with the HLOOKUP function<\/h3>\n<p>There are two problems with this function:<\/p>\n<ol>\n<li>For looking up <strong>search_key<\/strong>, it always uses the first row within the input <strong>range<\/strong>-. So it is not possible with the HLOOKUP function to fetch a cell value that is above the lookup row.<\/li>\n<li>The function is not dynamic enough, in that, inserting a row between the input <strong>range<\/strong> doesn\u2019t automatically update the row index.<\/li>\n<\/ol>\n<p>There\u2019s an alternative that solves the above two problems. Please go through the explanation for the <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/match-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener noreferrer\">INDEX and MATCH function combination.<\/a> It is explained in the context of VLOOKUP function, but is equally applicable as a HLOOKUP alternative.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.22.2&#8243; background_color=&#8221;#f9f9ff&#8221; custom_margin=&#8221;40px||40px||false|false&#8221; custom_padding=&#8221;15px|25px|15px|25px|true|true&#8221; border_width_left=&#8221;3px&#8221; border_color_left=&#8221;#808e95&#8243; global_module=&#8221;26540&#8243; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><em><strong>Editor\u2019s note<\/strong>: This is a revised version of a previous post that has been updated for accuracy and comprehensiveness.<\/em><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The HLOOKUP function is perhaps not as famous and widely used as its counterpart, VLOOKUP function. However, the two functions are the same, with the HLOOKUP function simply being the transposed version of VLOOKUP. It stands for \u2018Horizontal Lookup\u2019. The function searches for a key value in the first row of the input range, and [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":29519,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"The <a href=\"https:\/\/support.google.com\/docs\/answer\/3093375?hl=en\">HLOOKUP<\/a> formula is perhaps not as famous and widely used as its counterpart, <a href=\"https:\/\/support.google.com\/docs\/answer\/3093318?hl=en&ref_topic=3105472\">VLOOKUP<\/a> formula. But, this too serves similar purpose, albeit in a transposed form. It stands for 'Horizontal Lookup'. This searches for a key value in the first row of the input range. And, it returns the value of a specified cell from the column where it finds the key. We can expect an error if the key doesn't exist.\n<h3>Syntax<\/h3>\n<strong><span style=\"font-family: courier new,courier,monospace; font-size: 14pt;\">HLOOKUP(search_key, range, index, [is_sorted])<\/span><\/strong>\n<ul>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>search_key<\/strong><\/span> - is the value that the HLOOKUP formula uses to search.<\/li>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>range<\/strong><\/span> - is the reference to the range of cells that we are performing a search on. Google Sheets application looks for the key in the first row of the range.<\/li>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>index<\/strong><\/span> - this is the row index of the cell within the range, whose value the formula returns. The first row's index within the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>range<\/strong><\/span> is 1, the second in the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>range<\/strong><\/span> is 2 and so on. For example, if we input 3 against this parameter, the HLOOKUP formula returns the cell value from the third row and the column in which it finds the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>search_key<\/strong><\/span>.<\/li>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>[is_sorted]<\/strong><\/span> - is an optional parameter which is TRUE by default. This indicates whether the first row in the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>range<\/strong><\/span> is sorted in ascending order or not. If not, we should specify the value as FALSE.<\/li>\n<\/ul>\n<h3>Usage: HLOOKUP Formula<\/h3>\n<h5>Use case: Numbers in the first row<\/h5>\nLet us try our hands on a few examples. Here is a test data with sales figures that a set of salespersons generated. We tried to answer various business case scenarios, using this formula. You'll observe the how <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>index<\/strong><\/span> parameter value affects the outcome.\n\n<img class=\"aligncenter size-full wp-image-3548\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-63.png\" alt=\"HLOOKUP Formula - Illustration 1\" width=\"1030\" height=\"396\" \/>\n\nHere's an interesting thing to note in the last case (row # 11 above). The formula returned an #N\/A error. Why? That is, as explained in the error description, because the $15000 sales figure does not exist in the first row. Therefore, it cannot return an appropriate value.\n<h5><\/h5>\n<h5>The curious case of <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\">[is_sorted]<\/span><\/h5>\nIn the examples, we have chosen FALSE for the last parameter if the first row within the input range is not sorted in ascending order. We chose TRUE otherwise. Now, what if we tried to do the opposite?\n\n<img class=\"aligncenter size-full wp-image-3550\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-64.png\" alt=\"HLOOKUP Formula - Illustration 2\" width=\"1013\" height=\"216\" \/>\n\nThe second case worked out well. But the first one, not as much! Why is that? Here is a note from the <a href=\"https:\/\/support.google.com\/docs\/answer\/3093375?hl=en\">official documentation<\/a> of HLOOKUP formula:\n<blockquote>Using an incorrect sort type may cause incorrect values to be returned.<\/blockquote>\nSo, there, they said it themselves! It will not give us expected results when we go with the TRUE option when the first row is not sorted. However, if we have sorted values in the first row, using TRUE for the last parameter will result in a much better performance.\n<h5><\/h5>\n<h5>Use case: Sorted strings in the first row<\/h5>\nNow that we got our hands greased with numbers, let us try with an example data set, in which the first row has sorted string values, as shown below. There are two examples each for all the three cases available, but with one distinction of <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>is_sorted<\/strong><\/span> parameter. Please observe how the HLOOKUP formula is behaving.\n\n<img class=\"aligncenter size-full wp-image-3556\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-65.png\" alt=\"HLOOKUP Formula - Illustration 3\" width=\"1023\" height=\"354\" \/>\n\nApparently, the TRUE or FALSE value for <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>is_sorted<\/strong><\/span> parameter doesn't really affect the behavior when it finds the <strong><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\">search_key<\/span><\/strong> within the first row of the range. But an interesting development happens when it doesn't find a match for the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>search_key<\/strong><\/span>. In the case of FALSE (row # 12), it was looking for an exact match. But in the case of TRUE (row # 13), it apparently is looking for a near match. This, obviously, may not be desirable in many cases.\n<h5><\/h5>\n<h5>Use case: Unsorted strings in the first row<\/h5>\nThe data we are considering for this use case is essentially the same as that used above. Except, we have non-sorted strings in the first row.\n\n<img class=\"aligncenter size-full wp-image-3557\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-66.png\" alt=\"HLOOKUP Formula - Illustration 4\" width=\"1024\" height=\"354\" \/>\n\nUnlike the previous example, the use of TRUE and FALSE values for the fourth parameter is generating different results. And we can deduce that the results are correct only when we used FALSE for <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>is_sorted<\/strong><\/span>.\n\nSo, what is the bottom line?\n<blockquote>Never lie to Google Sheets in the<strong> <span style=\"font-family: courier new,courier,monospace;\">is_sorted<\/span><\/strong> parameter! Seemingly, it returns the favor!<\/blockquote>\n<h5><\/h5>\n<h5>Use case: Multiple matches in the first row<\/h5>\nThere will be instances where we may encounter multiple instances of the same value in the first row. In the example below, Barry occurred twice. What happens if we use HLOOKUP formula in such scenario? Let's find out.\n\n<img class=\"aligncenter size-full wp-image-3560\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-67.png\" alt=\"HLOOKUP Formula - Illustration 5\" width=\"1018\" height=\"217\" \/>\n\nYou may have noticed, it picks up the first Barry it encounters in the list. And it doesn't consider the the second Barry within the row.\n<h5><\/h5>\n<h5>Use case: Drawbacks with the HLOOKUP formula<\/h5>\nThere are two problems with this formula:\n<ol>\n \t<li>For looking up <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>search_key<\/strong><\/span>, it always uses the first row within the input <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>range<\/strong><\/span>. So it is not possible with HLOOKUP formula to fetch a cell value that is above the lookup row.<\/li>\n \t<li>The formula is not dynamic enough, in that, inserting a row between the input <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>range<\/strong><\/span> doesn't automatically update the row index.<\/li>\n<\/ol>\nThere's an alternative that solves the above two problems. Please go through the explanation for the INDEX and MATCH formula combination <a href=\"https:\/\/www.sheetgo.com\/match-formula-google-sheets\/\">here.<\/a> It is explained in the context of VLOOKUP formula, but is equally applicable as an HLOOKUP alternative.\n\n\u00a0","_et_gb_content_width":"","footnotes":""},"categories":[54],"tags":[39,28],"class_list":["post-3504","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-sheets-formulas","tag-connections-t","tag-spreadsheets"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/posts\/3504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/comments?post=3504"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/posts\/3504\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/media\/29519"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/media?parent=3504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/categories?post=3504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/es\/wp-json\/wp\/v2\/tags?post=3504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}