Index and Match Excel Question.

DNapoli

New Member
Joined
Mar 13, 2012
Messages
35
Office Version
  1. 365
Tab1 "01.31.2021" has a "Total" line in column B. I want to return the values in columns C, D, E ,F,G, and H from the "Total Line" in my second tab.
Tab2 "Metrics V3" starts in column L 17 and goes down. I want to populate the totals from the 1st sheet into the 2nd sheet (Metrics V3)
My formula does not drag down in the 2nd sheet. I had to edit it to get it to work manually. What am I doing incorrectly?
=INDEX('01.31.2021'!$C:$H, MATCH("Total", '01.31.2021'!$B:$B, 0) + ROW() - ROW($L$17), COLUMN() - COLUMN($L$17) + 1)

=INDEX('01.31.2021'!$C:$H, MATCH("Total", '01.31.2021'!$B:$B, 0) + ROW(L18) - ROW($L$18), COLUMN() - COLUMN($L$18) + 2)
=INDEX('01.31.2021'!$C:$H, MATCH("Total", '01.31.2021'!$B:$B, 0) + ROW(L19) - ROW($L$19), COLUMN() - COLUMN($L$19) + 3)
View attachment 108883

01.31.2021 Tab

1711218198590.png



Metrics V3 Tab



1711218117270.png
 
.. provided '01.31.2021' only has one "Total" row. Also, filter on an entire column like that is relatively slow compared to a MATCH type function.

This would be my suggestion for L17 on 'Metrics V3'
Excel Formula:
=TRANSPOSE(INDEX('01.31.2021'!C:H,XMATCH("Total",'01.31.2021'!B:B),0))
Thank you Peter!! I will try this.
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I tried that and got an error. Please see my sheet and formula below. =LET(data,INDIRECT(C14&"!C:G"),dataB,INDIRECT(C14&"!B:B"),TRANSPOSE(INDEX(data,XMATCH("Total",dataB),0))) Error Array result was not expanded because it would overwright data in C18.
 

Attachments

  • Screenshot 2024-03-24 151810.png
    Screenshot 2024-03-24 151810.png
    52.7 KB · Views: 12
Upvote 0
Delete the information in C18 and down just far enough to give the array room to spill…those cells need to be empty so the array can expand.
And to clarify, does your worksheet name begin with 0?…I’ve seen it both ways in earlier posts. C14 shows the 0 version name.
 
Last edited:
Upvote 0
Delete the information in C18 and down just far enough to give the array room to spill…those cells need to be empty so the array can expand.
And to clarify, does your worksheet name begin with 0?…I’ve seen it both ways in earlier posts. C14 shows the 0 version name.
 
Upvote 0
Thank you for this information. C18 to C 21 is now blank but when I enter the formula it gives a #REF! error.

=G22 LET(data,INDIRECT(C14&"!C:G"),dataB,INDIRECT(C14&"!B:B"),TRANSPOSE(INDEX(data,XMATCH("Total",dataB),0))) The work sheet is "01.31.2021" See attached error In C 17 when pasting the formula.
1711322444234.png
 
Upvote 0
What is the G22 that appears in that screen snapshot where the formula is shown? And is the sheet named 01.31.2021 exactly?
 
Upvote 0
I noticed the error message you mentioned...
Error Array result was not expanded because it would
I've never seen that before in Excel. Are you using Google Sheets? Seems to work okay in Sheets too. Check your sheet names carefully to confirm that the C14 entry matches the worksheet name exactly.
1711327512508.png
 
Last edited:
Upvote 0
I think Sheets may be interpreting your 01.31.2021 entry in cell C14 as a date, which will be treated as a number, and that won't match the text name of your worksheet. Try editing C14 to force it to text by adding a ' (a single apostrophe) before the rest of the entry, as in '01.31.2021
 
Upvote 0
@DNapoli
Please confirm that this is a Google Sheets question, not a Microsoft Excel question.
 
Upvote 0

Forum statistics

Threads
1,215,072
Messages
6,122,968
Members
449,095
Latest member
Mr Hughes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top