{"id":32240,"date":"2021-03-03T10:45:48","date_gmt":"2021-03-03T09:45:48","guid":{"rendered":"https:\/\/blog.sheetgo.com\/?p=32240"},"modified":"2021-03-03T10:45:48","modified_gmt":"2021-03-03T09:45:48","slug":"indice-excel","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/pt\/blog\/excel-functions\/index-excel\/","title":{"rendered":"Como usar a fun\u00e7\u00e3o INDEX do 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;][et_pb_row _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#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;][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p>The <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/index-function-a5dcf0dd-996d-40a4-a822-b56b061328bd\" target=\"_blank\" rel=\"noopener noreferrer\">INDEX function<\/a> in Excel returns the value of a specified cell within an array. You essentially tell the function the array and the coordinates of the cell within the array, and the function returns the value of that cell. INDEX is useful on its own to pull data out of a larger dataset, or in combination with other functions like the MATCH function.<\/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;]<\/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;]=INDEX(array, row_num, [column_num])[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<ul>\n<li><b>array<\/b> is the range of cells the function will reference<\/li>\n<li><b>row_num<\/b> is the row number, within the array, of the cell to reference<\/li>\n<li><b>column_num<\/b> is the column number of the cell to reference. If left blank, the function will default to column 1<\/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;]<\/p>\n<h3>How to use the INDEX Excel function<\/h3>\n<p>In its most basic form, the INDEX function takes coordinates in the form of a row and column number, and uses those coordinates to find a cell within the specified array.<\/p>\n<p>This is demonstrated in the example below.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/03\/1.-INDEX-basic-example.png&#8221; alt=&#8221;INDEX Excel 1 basic example&#8221; title_text=&#8221;1. INDEX basic example&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.23.1&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; sticky_enabled=&#8221;0&#8243;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p>Here I\u2019ve used the formula <b>=INDEX(A2:B6,3,2)<\/b> to return the depth of the Atlantic Ocean. The function looks within the array A2:B6, and finds the cell in the third row and second column. As you can see, it properly returns the value in that cell!<\/p>\n<p>It\u2019s important to note that the INDEX function is a reference function, which means it doesn\u2019t perform any calculation of its own.<\/p>\n<p>Basically, all it does is locate a cell and reference the value within that cell. To demonstrate this, watch what happens when I change the value in the referenced cell.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/03\/2.-INDEX-reference-cell.png&#8221; alt=&#8221;INDEX Excel 2 reference cell&#8221; title_text=&#8221;2. INDEX reference cell&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p>I changed the Atlantic depth to 100, and the reference cell reflected the change. I didn\u2019t touch the formula in E3, but it updated all on its own!<\/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;]<\/p>\n<h4>Reference form<\/h4>\n<p>The INDEX function is most commonly used in Array form, which is what I just showed. However, there\u2019s an alternative form of this function called the Reference form.<\/p>\n<p>In Reference form, the INDEX function can take multiple input arrays.<\/p>\n<p>In order to do this, you have to specify which array you want to search. You can do this by adding a fourth parameter to the function:<\/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;]=INDEX(reference, row_num, [column_num], [area_num])[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p>The <b>area_num<\/b> parameter tells the function which reference array to look in. If left blank, it defaults to the first array.<\/p>\n<p>To get a better idea of how INDEX works in Reference form, take a look at the next example.<\/p>\n<p>I now have three tables of data. I can use the Reference form of the INDEX function to incorporate all three within a single function by typing <b>=INDEX((A2:B6,D2:E6,G2:H6),5,2,2)<\/b>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/03\/3.-INDEX-reference-form.png&#8221; alt=&#8221;INDEX Excel 3 reference form&#8221; title_text=&#8221;3. INDEX reference form&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p>As you can see from the formula, you can enter all three arrays for the reference parameter. Make sure you enclose them in brackets and separate them with commas.<\/p>\n<p>Next, specify the row and column numbers to reference, just like in the earlier example.<\/p>\n<p>Finally, there\u2019s the <b>area_num<\/b> parameter at the end. This parameter (2) tells the function to look in the second array. After typing all this in, I get the correct result pulled from the data!<\/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;]<\/p>\n<h4>INDEX with COUNTA<\/h4>\n<p>As shown in the examples above, the INDEX function is very useful on its own. But like many functions, it really hits its stride when combined with other functions.<\/p>\n<p>One useful example is combining INDEX with COUNTA.<\/p>\n<p>This combination lets you automatically reference the last entry in a dataset, so that your INDEX function will always reference the most recent data. This is handy when you have a live spreadsheet that is updated regularly.<\/p>\n<p>In the example below, I have some data on weekly rainfall. This table is updated every week, and I want to quickly have a reference to the latest numbers. I achieve this by typing <b>=INDEX(A:B,(COUNTA(A:A)),2)<\/b>.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/03\/4.-INDEX-with-COUNTA.png&#8221; alt=&#8221;INDEX Excel 4 index with counta&#8221; title_text=&#8221;4. INDEX with COUNTA&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p>Now how does this work? The function uses the entire A and B columns as its reference array, which means anything added to those columns will fall within the array.<\/p>\n<p>To specify which row I want to reference, I use the COUNTA function to count how many rows are populated. If 5 rows are populated, then I want to reference row 5 \u2013 COUNTA makes this happen.<\/p>\n<p>Now comes the real test: does the function automatically update when I add new data? In the screenshot below I\u2019ve added week 5, and you can see that the function automatically changed to show this new data!<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/03\/5.-INDEX-with-COUNTA-updated.png&#8221; alt=&#8221;INDEX Excel 5 index with counta&#8221; title_text=&#8221;5. INDEX with COUNTA updated&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h3>Final thoughts<\/h3>\n<p>Clearly, the INDEX function in Excel is quite powerful when combined with other functions.<\/p>\n<p>Another common combination is <a href=\"https:\/\/www.sheetgo.com\/blog\/excel-functions\/index-match-excel\/\">INDEX and MATCH<\/a>, which combines to form a more flexible version of the <a href=\"https:\/\/www.sheetgo.com\/blog\/excel-functions\/vlookup-excel\/\">VLOOKUP function<\/a>. I encourage you to check it out!<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The INDEX function in Excel returns the value of a specified cell within an array. You essentially tell the function the array and the coordinates of the cell within the array, and the function returns the value of that cell. INDEX is useful on its own to pull data out of a larger dataset, or [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":32241,"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,28],"class_list":["post-32240","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel-functions","tag-connections-t","tag-spreadsheets"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/32240","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=32240"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/32240\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media\/32241"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media?parent=32240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/categories?post=32240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/tags?post=32240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}