Another INDEX MATCH question

juangregory

New Member
Joined
Jul 29, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Dear Excel gurus: i have a sheet that looks like this:
DepartmentPeriodHours Worked
Alpha1324
Alpha2421
Alpha3221
Beta1331
Beta289
Beta3111
Gamma10
Gamma212
Gamma3212

And what I'm trying to do is to have another sheet do a lookup on a Field List with Alpha, Beta, Gamma, etc. and pull the Department, all periods, and all hours so that I can graph them. That way the end user can use the dropdown to see historical trending.

So let's say i have another sheet that has this:

(Dept pulldown)
PeriodHours
1
2
3
4

But =index('Sheet1!a:c',match($a$1,'Sheet1!a:a',0),match(a3,'Sheet1!b:b',0)) in the Hours column only gets me a #REF.

Is this because Period in Sheet1 is not a unique value? Is there a workaround?

Thank you in advance.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You can try this array formula (confirmed using CTRL+SHIFT+ENTER, not just ENTER). When done properly, you will see braces, {} around the formula in the formula bar. Don't add those yourself. Also, adjust the bottom row to a number that will always be greater than your last used row. Avoid using full columns, e.g. C:C, A:A, B:B in array formulas (and in many other cases).

=INDEX(Sheet1!$C$1:$C$20,MATCH($A$1&$A3,Sheet1!$A$1:$A$20&Sheet1!$B$1:$B$20,0))
 
Upvote 0
You can try this array formula (confirmed using CTRL+SHIFT+ENTER, not just ENTER). When done properly, you will see braces, {} around the formula in the formula bar. Don't add those yourself. Also, adjust the bottom row to a number that will always be greater than your last used row. Avoid using full columns, e.g. C:C, A:A, B:B in array formulas (and in many other cases).

=INDEX(Sheet1!$C$1:$C$20,MATCH($A$1&$A3,Sheet1!$A$1:$A$20&Sheet1!$B$1:$B$20,0))
Thank you pjoaquin that worked like a charm! you're a wizard! I don't think i've ever seen an example where concatenation was used in Index/Match and it never would have occurred to me to try it. You might have just saved me a whole saturday at work!
 
Upvote 0
Don't tell your boss that... let them think you worked all day to get that done. (j/k)

:)
 
Upvote 0
You can try this array formula (confirmed using CTRL+SHIFT+ENTER, not just ENTER). When done properly, you will see braces, {} around the formula in the formula bar.
@pjoaquin @juangregory
Since the OP is using Microsoft 365, there is no need to use the Ctrl+Shift+Enter. Normal entry will do and the formula will not have the {} around it.

@juangregory
I'm not sure of your full data and its arrangement but based on your sample, you could try this shorter formula instead. Note that this does not need to be copied down, just entered in the top result cell.

juangregory.xlsm
AB
1Beta
2Period
31331
4289
53111
64
Sheet2
Cell Formulas
RangeFormula
B3:B5B3=FILTER(Sheet1!C2:C20,Sheet1!A2:A20=A1,"")
Dynamic array formulas.
 
  • Like
Reactions: Z51
Upvote 0
@juangregory
I have removed the 'Mark as Solution' mark from this thread. Please don't mark your own post as the solution unless it contains the solution that you provided. Please mark the actual post that best solves your problem.
 
Upvote 0
@Peter - thanks for the update; I suppose i should have read the rules for posting more closely. New here. Also, I wanted to thank you for pointing me in the direction of the Filter function. Just watched one of Leila Gharani's vids on the same thing and it has some interesting possibilities for another project I'm working on.
 
Upvote 0

Forum statistics

Threads
1,224,862
Messages
6,181,466
Members
453,045
Latest member
Abraxas_X

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