{"id":2394,"date":"2020-11-30T09:03:00","date_gmt":"2020-11-30T08:03:00","guid":{"rendered":"https:\/\/importsheet.com\/?p=2394"},"modified":"2025-06-16T21:26:02","modified_gmt":"2025-06-16T19:26:02","slug":"formule-de-correspondance-google-sheets","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/fr\/blog\/google-sheets-formulas\/match-formula-google-sheets\/","title":{"rendered":"Comment utiliser la fonction MATCH dans 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; da_is_popup=&#8221;off&#8221; da_exit_intent=&#8221;off&#8221; da_has_close=&#8221;on&#8221; da_alt_close=&#8221;off&#8221; da_dark_close=&#8221;off&#8221; da_not_modal=&#8221;on&#8221; da_is_singular=&#8221;off&#8221; da_with_loader=&#8221;off&#8221; da_has_shadow=&#8221;on&#8221; da_disable_devices=&#8221;off|off|off&#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>In Google Sheets, the <a href=\"https:\/\/support.google.com\/docs\/answer\/3093378?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">MATCH<\/a> function gives you the <strong>relative position<\/strong> of an item within a range of cells. Basically, if you want to know the position of a specific value within a range or array, MATCH will tell you where it&#8217;s located.\u00a0MATCH is handy but fairly basic, but when you combine it with INDEX, it becomes pretty powerful. The <a href=\"#index-match-function\">INDEX MATCH function<\/a> combination is a brilliant, more dynamic alternative to the VLOOKUP function. It solves many of the problems associated with VLOOKUP.<\/p>\n<h4>MATCH<\/h4>\n<p>Firstly, let&#8217;s take a look at the MATCH function and how it works in Google Sheets.<\/p>\n<p>Remember that MATCH returns a <strong>position<\/strong> but not a value, so if you want to return a value itself, use <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/index-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener noreferrer\">INDEX<\/a>, <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/use-hlookup-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener noreferrer\">HLOOKUP<\/a>, or <a href=\"https:\/\/support.google.com\/docs\/answer\/3093318?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">VLOOKUP<\/a>.<\/p>\n<p>In the snapshot below you can see that the position of <strong>Evan<\/strong> is <strong>5<\/strong> within the range of cells <strong>A1 to A6<\/strong>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/11\/Match-image-1.png&#8221; alt=&#8221;match-function-google-sheets-1&#8243; title_text=&#8221;Match image 1&#8243; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; width=&#8221;100%&#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; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>What if you place the cells as shown in the snapshot below (B4 to B9)?<\/p>\n<p>The relative position of <strong>Evan<\/strong>\u00a0still remains\u00a0<strong>5<\/strong>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/11\/Match-image-2.png&#8221; alt=&#8221;match-function-google-sheets-2&#8243; title_text=&#8221;Match image 2&#8243; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; width=&#8221;100%&#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>That is exactly what the MATCH function is designed to do \u2013 return the relative position of an item (\u2018Evan\u2019) in a range of cells (A1:A6 or B4:B9).<\/p>\n<h3>Syntax<\/h3>\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;]<\/p>\n<p>=MATCH(search_key, range, search_type)<\/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><\/h3>\n<ul>\n<li><strong>search_key<\/strong> \u2013 is the <strong>item<\/strong> that the MATCH function searches for within the <strong>range<\/strong> of cells. It can be a pure text (\u2018<strong>Evan<\/strong>\u2019), or a cell reference (like <strong>A7<\/strong>), or even a function that returns a string or a number (like LEFT(\u201cMike Johnson\u201d,8) or DATE(2017,1,1))<\/li>\n<li><strong>range<\/strong> \u2013 is the group of cells where the MATCH function searches for the item (search_key). This must be a one-dimensional array, i.e. either a range with a single column or a single row.<\/li>\n<li><strong>search_type<\/strong> \u2013 is an optional input that directs how the MATCH function should search for the <strong>search_key<\/strong> in the<strong> range<\/strong>. This takes in three different values:\n<ul>\n<li><strong>1<\/strong>\u00a0is the default value (i.e. when no input is provided against <strong>search_type<\/strong>). Going with this option, Google Sheets assumes that the range of cells are sorted in ascending order, and accordingly returns the largest value less than or equal to <strong>search_key<\/strong>.<\/li>\n<li><strong>0<\/strong> specifies Google Sheets that it must find an exact match. This is the ideal option to go with if the <strong>range<\/strong> of cells is not sorted in any order.<\/li>\n<li>&#8211;<strong>1<\/strong>, as one would guess, is the exact opposite of <strong>1<\/strong>. This option assumes that the range of cells are sorted in descending order, and returns the smallest value greater than or equal to <strong>search_key<\/strong>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>How to use MATCH in Google Sheets<\/h4>\n<p>Take a look at the screenshot below. In column A, I have a set of data in ascending order (e.g. smallest to largest). I\u2019ve tried out a few variations of the MATCH function on this data.<\/p>\n<p>In the first example, in row 2, I\u2019ve asked the MATCH function to search for ID #1400 by typing =Match(1400,A2:A15,1).<\/p>\n<p>The second formula, in row 3, does the same as the first, and both tell me that ID #1400 is in the 7th row.<\/p>\n<p>The difference is that in the first example, I used search_type 1, which is used when the data is in ascending order (which it is).<\/p>\n<p>The second time, I used search_type 0, which is used when the data is not sorted, or when you only want an exact match. Because the data was sorted, and there was an exact match for 1400, both functions gave me the same result.<\/p>\n<p>In the third example, in row 4, I ask the MATCH function to find me ID #1300 by typing =Match(1300,A2:A15,0). I use search_type 0 to specify that I want an exact match. Because there is no ID #1300, I get an error.<\/p>\n<p>In the fourth example in row 5, however, I ask the same thing but use search_type 1. Here, the function does give me a result, indicating that the answer is in row 4.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/11\/Match-image-3.png&#8221; alt=&#8221;match-function-google-sheets-3&#8243; title_text=&#8221;Match image 3&#8243; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; width=&#8221;100%&#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; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h4>Note about MATCH<\/h4>\n<p>One thing to remember is that the MATCH function won\u2019t necessarily give you the closest answer \u2014 as you can see, row 4 corresponds to ID #1125.<\/p>\n<p>The next row, ID #1313, is much closer to the ID #1300 I was asking for. However, when searching data in ascending order, the function returns the closest value that is no larger than the search_key. Because of this, it returns row 4 as the result, not row 5.<\/p>\n<p>In the last pair of examples, in row 6 and 7, instead of typing in the <strong>search_key<\/strong> directly, I indicate a reference cell which contains the <strong>search_key<\/strong>. I do this with the function <strong>=Match(D2,A2:A15,1)<\/strong>.<\/p>\n<p>In the next example, I\u2019ll show the data sorted in descending order.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/11\/Match-image-4.png&#8221; alt=&#8221;match-function-google-sheets-4&#8243; title_text=&#8221;Match image 4&#8243; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; width=&#8221;100%&#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; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The examples here are the same as in the first image, except I am now using a<strong> search_key of <\/strong>-1 instead of 1 to reflect the fact that the data is sorted in descending order.<\/p>\n<p>Notice the example of searching for ID #1300 \u2013 this time, the function gives a result of row 10, which corresponds to ID #1313, much closer to 1300 than when the same thing was done with the data sorted in ascending order.<\/p>\n<h4>Using MATCH with text<\/h4>\n<p>The examples have shown have been with numeric values. How about using the MATCH function with text values?<\/p>\n<p>Since you can\u2019t exactly define the \u2018less than\u2019 and \u2018greater than\u2019 values for text forms, I usually go with the <strong>search_type 0<\/strong>, which tells Google Sheets to search for an exact match. Here are a few examples:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/11\/Match-image-5.png&#8221; alt=&#8221;match-function-google-sheet-.5&#8243; title_text=&#8221;Match image 5&#8243; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; width=&#8221;100%&#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>Notice how the <strong>search_key<\/strong> needs to be in quotation marks when it is a text string, like in the first example: <strong>=Match(&#8220;Eric&#8221;,A2:A14,0)<\/strong>. Another thing to remember is that when using <strong>search_key 0<\/strong> to search for an exact match, if there is no exact match the function will give an error (like in the first example above).<\/p>\n<p>I\u2019ve been using the MATCH function in a vertical layout because that\u2019s most common. But there are certainly times when you might want to use it for a horizontal data set. In the example below, I\u2019ve done just that.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/05\/MATCH-FORMULA-GOOGLE-SHEETS-RANGE-WITH-TEXT-2.png&#8221; alt=&#8221;MATCH FORMULA GOOGLE SHEETS MATCH WITH TEXT 2&#8243; title_text=&#8221;MATCH FORMULA GOOGLE SHEETS MATCH WITH TEXT 2&#8243; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text module_id=&#8221;index-match-function&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Here, the MATCH function tells you the number of the column that contains the<strong> search_key<\/strong>.<\/p>\n<h3><strong>How to use the INDEX MATCH function combination<br \/> <\/strong><\/h3>\n<p>Perhaps the most powerful use of MATCH in Google Sheets is when you use it in combination with the INDEX function, in order to look up values. But there&#8217;s already a VLOOKUP function in Google Sheets for that purpose, right?<\/p>\n<p>True\u00a0\u2014 but the combination of MATCH and INDEX can solve several problems that arise when using VLOOKUP.<\/p>\n<p>Take a look at the VLOOKUP example below:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2020\/11\/Match-image-7.png&#8221; alt=&#8221;match-function-google-sheets-7&#8243; title_text=&#8221;Match image 7&#8243; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; width=&#8221;100%&#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; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The VLOOKUP function in D2 looks up 161 in the \u2018Emp ID #\u2019 column (as it\u2019s the leftmost in the range A2:B11), and from the row where it finds the value 161, it fetches the value located in the second column (i.e. column B), while assuming the data is not sorted. So far, so good. But there are two critical problems when using VLOOKUP in Google Sheets.<\/p>\n<h4>Problem 1: Static cell referencing<\/h4>\n<p>What happens when you insert a new column between the first and second columns? Let\u2019s try that.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/05\/MATCH-FORMULA-GOOGLE-SHEETS-STATIC-CELL-REFERENCING.png&#8221; alt=&#8221;MATCH FORMULA GOOGLE SHEETS STATIC CELL REFERENCINGMATCH FORMULA GOOGLE SHEETS STATIC CELL REFERENCING&#8221; title_text=&#8221;MATCH FORMULA GOOGLE SHEETS STATIC CELL REFERENCING&#8221; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; width=&#8221;100%&#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; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>You\u2019ll notice the returned value is not <strong>Ethan<\/strong>\u00a0anymore. This is because VLOOKUP is a semi-static function.<\/p>\n<p>Google Sheets updated the second parameter to reflect the new range, but it did not accordingly change the column index (third parameter) when a new column was added before the <strong>Salesperson<\/strong> column.<\/p>\n<h4>Problem 2: Lookup column is always the leftmost<\/h4>\n<p>You might find yourself in a situation where you have to look up values from a column (Emp ID #) that is not the leftmost, as shown below.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/05\/MATCH-FORMULA-GOOGLE-SHEETS-PROBLEM-2.png&#8221; alt=&#8221;MATCH FORMULA GOOGLE SHEETS PROBLEM 2&#8243; title_text=&#8221;MATCH FORMULA GOOGLE SHEETS PROBLEM 2&#8243; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; width=&#8221;100%&#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; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>In this case, moving the Emp ID # column to make it the leftmost would work. But that isn\u2019t an ideal approach \u2013 there can be data layout or presentation specifications that do not allow you to re-arrange columns. In that situation, what can you do? The MATCH and INDEX function combination comes to the rescue. Here\u2019s the combination syntax, followed by a few examples.<\/p>\n<h4>INDEX(reference, MATCH(search_key, range, search_type))<\/h4>\n<p>The key to this combination is that both the ranges selected for the INDEX and MATCH functions, respectively, need to be a single column. You are essentially using a VLOOKUP function, but specifying the column to look in, and the column to return the value from, in separate ranges within the MATCH and INDEX functions. As you\u2019ll see, this methodology helps you avoid the errors that can occur using VLOOKUP.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/05\/MATCH-FORMULA-GOOGLE-SHEETS-INDEX.png&#8221; alt=&#8221;MATCH FORMULA GOOGLE SHEETS INDEX&#8221; title_text=&#8221;MATCH FORMULA GOOGLE SHEETS INDEX&#8221; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; width=&#8221;100%&#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; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>In the above example, I\u2019ve used the MATCH function to tell me which row contains Emp ID #161 within column C. The function returns a number that tells the INDEX function which row in column A to look for the Salesperson. The result is that the two functions combine to tell me the correct name (Ethan) for Emp ID #161. The function I used to do this is <strong>=INDEX(A2:A11,MATCH(161,C2:C11,0))<\/strong>.<\/p>\n<p>As you can see, unlike VLOOKUP, the combination works even if the lookup column is not the leftmost (see the first three examples in the above screenshot). Not surprisingly, it also works like VLOOKUP, when the lookup column is the leftmost.<\/p>\n<p>Let\u2019s also see whether the functions hold up when you introduce a new column in between.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/05\/MATCH-FORMULA-GOOGLE-SHEETS-INDEX-2.png&#8221; alt=&#8221;MATCH FORMULA GOOGLE SHEETS INDEX 2&#8243; title_text=&#8221;MATCH FORMULA GOOGLE SHEETS INDEX 2&#8243; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.20.2&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Thankfully, they still work. As soon as I introduced a new column (State), Google Sheets updated the references automatically to accommodate this change.<\/p>\n<p>As you\u2019ve seen above, the MATCH and INDEX function combination is much more flexible and versatile than the already popular and powerful VLOOKUP function. But the combination of these functions can be even more powerful when you use two MATCH functions instead of just one.<\/p>\n<p>[\/et_pb_text][et_pb_text admin_label=&#8221;Connections T &#8211; One tool &#8211; Horizontal&#8221; module_class=&#8221;sheetgo-post-no-shadow-img md2-contained-button vertical-banner-container&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#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; global_colors_info=&#8221;{}&#8221; global_module=&#8221;255434&#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;\">One tool to merge, split, and filter all your spreadsheet data<\/span><\/p>\n<p><a href=\"https:\/\/www.sheetgo.com\/connections\/\" target=\"_blank\" rel=\"noopener\">Find out how<\/a><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.20.2&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>How to use INDEX function with 2 MATCH functions<\/h3>\n<p>You\u2019ve now seen how useful the INDEX and MATCH combination can be. But what if you have a bi-dimensional array from which you want to get a value? In this case, you can use the MATCH function twice within the INDEX function, as shown in the example below.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/05\/MATCH-FORMULA-GOOGLE-SHEETS-INDEX-3.png&#8221; alt=&#8221;MATCH FORMULA GOOGLE SHEETS INDEX 3&#8243; title_text=&#8221;MATCH FORMULA GOOGLE SHEETS INDEX 3&#8243; align=&#8221;center&#8221; module_class=&#8221;sheetgo-post-no-shadow-img&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#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>In this example, you can see data on the average temperature in each month, for the years 2015-2020. If you want to pull the average temperature of a specific month of a specific year out of this array, you can use the INDEX and MATCH combination to accomplish this. The function used here is:<br \/>=INDEX(B2:M7, Match(B11, A2:A7, false), Match(B10, B1:M1, false))<\/p>\n<p>As you can see, I am using the MATCH function to give me the location of the row for the year I am looking for (in this case it\u2019s 2018, which is in the 4th row of data) as well as the column for the month I am looking for (September, in the 9th column of data). The INDEX function then takes these co-ordinates and returns the average temperature for September 2018.<\/p>\n<p>By using the INDEX and MATCH functions, you can not only get a search function that is more versatile than VLOOKUP, but you can also search bi-dimensional arrays. To learn more about the INDEX function and its use, check out the following blog post: <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/index-formula-google-sheets\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to use the INDEX function in Google Sheets.<\/a><\/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; 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_code _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_code][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Google Sheets, the MATCH function gives you the relative position of an item within a range of cells. Basically, if you want to know the position of a specific value within a range or array, MATCH will tell you where it&#8217;s located.\u00a0MATCH is handy but fairly basic, but when you combine it with INDEX, [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":27672,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"In Google Sheets, the <a href=\"https:\/\/support.google.com\/docs\/answer\/3093378?hl=en\">MATCH<\/a> formula gives us the relative position of an item in a range of cells. To understand this, please see the snapshot below. The position of '<strong>Evan<\/strong>' is 5 within the range of cells A1 through A6.\n\n<img class=\"aligncenter wp-image-2395 size-full\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/match1.png\" alt=\"MATCH formula - Illustration 1\" width=\"149\" height=\"156\" \/>\n\nWhat if we place the cells as shown in the below snapshot (B4 through B9)? The relative position of \"Evan\" would still remain 5.\n\n<img class=\"size-full wp-image-2397 aligncenter\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/match2.png\" alt=\"MATCH formula - Illustration 2\" width=\"254\" height=\"219\" \/>\n\nThat is exactly what the MATCH formula is set out to do - return the relative position of an <strong>item<\/strong> ('<strong>Evan<\/strong>') in a <strong>range<\/strong> of cells (<strong>A1:A6<\/strong> or <strong>B4:B9<\/strong>).\n<h3>Syntax<\/h3>\n<span style=\"font-family: courier new,courier,monospace; font-size: 14pt;\"><strong>MATCH(search_key, range, search_type)<\/strong><\/span>\n<ul>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>search_key<\/strong><\/span> \u2013 is the <strong>item<\/strong> that the MATCH formula searches within the <span style=\"font-size: 12pt; font-family: courier new,courier,monospace;\"><strong>range<\/strong><\/span> of cells. It can be a pure text ('<span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>Evan<\/strong><\/span>'), or a cell reference (like <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>A7<\/strong><\/span>), or even a function that returns a string or a number (like <span style=\"font-size: 12pt; font-family: courier new,courier,monospace;\"><strong>LEFT(\"Mike Johnson\",8)<\/strong><\/span> or <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>DATE(2017,1,1)<\/strong><\/span>)<\/li>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>range<\/strong> <\/span>\u2013 is the group of cells where the MATCH formula searches for the <strong>item (<span style=\"font-size: 12pt; font-family: courier new,courier,monospace;\">search_key<\/span>)<\/strong>. This must be a one-dimensional array, i.e. either a range with a single column or a single row.<\/li>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>search_type<\/strong><\/span> \u2013 is an optional input that directs how the MATCH formula should search for the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>search_key<\/strong><\/span> in the <span style=\"font-size: 12pt; font-family: courier new,courier,monospace;\"><strong>range<\/strong><\/span>. This takes in three different values:\n<ul>\n \t<li><strong>1<\/strong>, is the default value (i.e. when no input is provided against <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>search_type<\/strong><\/span>). Going with this option, Google Sheets assumes that the range of cells are sorted in ascending order, and accordingly returns the largest value less than or equal to <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>search_key<\/strong><\/span>.<\/li>\n \t<li><strong>0<\/strong>, specifies Google Sheets that it must go for an exact match. This is the ideal option to go with if the <span style=\"font-size: 12pt; font-family: courier new,courier,monospace;\"><strong>range<\/strong> <\/span>of cells are not sorted in any order.<\/li>\n \t<li><strong>-1<\/strong>, as one would guess, is the exact opposite of <strong>1<\/strong>. This option assumes that the range of cells are sorted in descending order, and returns the smallest value greater than or equal to <span style=\"font-size: 12pt; font-family: courier new,courier,monospace;\"><strong>search_key<\/strong><\/span>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Examples<\/h3>\nWithin column A, I have a test data in ascending order, on which I\u2019ve tried a few variations of the MATCH formula.\n\n<img class=\"wp-image-2399 size-full aligncenter\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/match3.png\" alt=\"MATCH formula - Illustration 3\" width=\"550\" height=\"344\" \/>\n\nWhat do we see in column C, if we sort data in column A in descending order? Let\u2019s find out.\n\n<img class=\"aligncenter wp-image-2400 size-full\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/match4.png\" alt=\"MATCH formula - Illustration 4\" width=\"551\" height=\"343\" \/>\n\nThat was with the numeric values. How about using the MATCH formula with text values? Since we can\u2019t exactly define the 'less than' and 'greater than' values for text forms, we usually go with the <span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>search_type<\/strong><\/span> option <strong>0<\/strong>, that tells Google Sheets to go for an exact match. Following are a few examples.\n\n<img class=\"aligncenter size-full wp-image-2401\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/match5.png\" alt=\"MATCH formula - Illustration 5\" width=\"548\" height=\"344\" \/>\n<h3><strong>Use case: INDEX &amp; MATCH formula combination\n<\/strong><\/h3>\nPerhaps the most powerful use of <a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/index-formula-google-sheets\">MATCH formula in Google Sheets<\/a> is when we use it along with the <a href=\"https:\/\/support.google.com\/docs\/answer\/3098242?hl=en\">INDEX<\/a> formula, in order to lookup values. But we already have <a href=\"https:\/\/support.google.com\/docs\/answer\/3093318?hl=en\">VLOOKUP<\/a> formula in Google Sheets for this purpose, don't we? We have an example below:\n\n<img class=\"aligncenter size-full wp-image-2402\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/match6.png\" alt=\"MATCH formula - Illustration 6\" width=\"527\" height=\"343\" \/>\n\nThe VLOOKUP formula in D2 looks up 1432 in the ID column (as it the left most in the range A2:B15), and from the row where it finds 1432, it fetches the value located in the second column (i.e. column B), while assuming the data is not sorted. So far, so good. But we have two critical problems with using VLOOKUP in Google Sheets.\n<h5><strong>Problem # 1<\/strong>: Static cell referencing.<\/h5>\nWhat happens when we insert a new column between the first and second columns? Let\u2019s try that.\n\n<img class=\"aligncenter size-full wp-image-2406\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/match7.png\" alt=\"MATCH formula - Illustration 7\" width=\"607\" height=\"342\" \/>\n\nYou\u2019ll notice the returned value is not \u2018<strong>Charlie<\/strong>\u2019 anymore. Because, it was a semi-static formula. Google Sheets updated the second parameter to reflect the new range, but it did not accordingly change the column index (third parameter) when we added a new column before the '<strong>Name<\/strong>' column.\n<h5><strong>Problem # 2<\/strong>: Lookup column is always the left most<\/h5>\nSituations may arise where the we might have to lookup values from a column (ID) that is not the left most, as shown below.\n\n<img class=\"aligncenter wp-image-2407 size-full\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/match8.png\" alt=\"MATCH formula - Illustration 8\" width=\"282\" height=\"132\" \/>\n\nWhat if we move the ID column to make it the left most? Good idea. But, that isn\u2019t an ideal approach. Because, there can be data layout or presentation specifications that do not allow us to re-arrange columns. What, in such a situation, is the solution? The INDEX and MATCH formula combination comes to our rescue. Here\u2019s the combination syntax, followed by a few examples.\n\n<span style=\"font-family: courier new,courier,monospace; font-size: 14pt;\"><strong>INDEX(reference, MATCH(search_key, range, search_type))<\/strong><\/span>\n\n<img class=\"aligncenter size-full wp-image-2408\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/match9.png\" alt=\"MATCH formula - Illustration 9\" width=\"650\" height=\"344\" \/>\n\nAs we can see, unlike VLOOKUP, the combination works even if the lookup column is not the left most (first three examples). Not surprisingly, it also works like VLOOKUP, when the lookup column is the left most.\n\nAlso, let\u2019s see whether the formulas still hold good, if we introduce a new column in between.\n\n<img class=\"aligncenter size-full wp-image-2409\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/11\/match10.png\" alt=\"MATCH formula - Illustration 10\" width=\"721\" height=\"342\" \/>\n\nThankfully, yes, they hold good. As soon as we introduced a new column (State), Google Sheets updated the references automatically to accommodate this change. Therefore, the INDEX &amp; MATCH formula combination is much more flexible and versatile than the already popular and powerful VLOOKUP formula.","_et_gb_content_width":"","footnotes":""},"categories":[54],"tags":[39,28],"class_list":["post-2394","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\/fr\/wp-json\/wp\/v2\/posts\/2394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/comments?post=2394"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/posts\/2394\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/media\/27672"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/media?parent=2394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/categories?post=2394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/tags?post=2394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}