INDEX-MATCH with a vertical lookup

Darren_workforce

Board Regular
Joined
Oct 13, 2022
Messages
146
Office Version
  1. 365
Platform
  1. Windows
I am working off of 2 tabs. The 'source' tab is what my supervisor updates so we know the team assignment breakdown and who falls under which manager. There are more columns but I am hoping 2 groups is enough. Row 2 is where each of the team manager names is entered.

On my second 'lookup' tab, I have the following formula:
Excel Formula:
=INDEX(source!B2:P2,MATCH(A2,source!B3:P33))
My hopes were to add an agent name down Column A of my 'lookup' tab and have it generate the manager name in Column B of the same tab. However, I'm getting an #N/A error. I've looked up a few websites and am not sure what it is I am doing wrong. The only thing I am guessing is that instead of looking left and right, I'm wanting to look up from the location of the agent name so I need to account for that?

Example: If I enter "Mary Thomas" into Column A of the 'lookup' tab, the results in the adjacent B cell would be "James"
Brittany Black would result in "Sydney"

SOURCE TAB:
1713557614165.png
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
There are lots of possibilities.
Mappe16
AB
2Aaron AlexanderSydney
Tabelle2
Cell Formulas
RangeFormula
B2B2=IF(COUNTIFS(Source!B6:B16,A2),Source!B2,"")&IF(COUNTIFS(Source!F6:F16,A2),Source!F2,"")
 
Upvote 0
An option for when you have multiple columns. This assumes your data starts in column B.
Book1
ABCDEFGHI
1JamesSarahSydneyHSarah
2AEC
3BFD
4G
5H
Sheet2
Cell Formulas
RangeFormula
I1I1=INDEX($B$1:$F$1,1,MIN(IF($B$2:$F$5=H1,COLUMN($B$1:$F$5)-1)))
 
Upvote 0
Solution
Good morning! Apologies for the delayed response. I tested both and both work. However, is there a way to be inclusive for additional columns without having to add additional
There are lots of possibilities.
Mappe16
AB
2Aaron AlexanderSydney
Tabelle2
Cell Formulas
RangeFormula
B2B2=IF(COUNTIFS(Source!B6:B16,A2),Source!B2,"")&IF(COUNTIFS(Source!F6:F16,A2),Source!F2,"")
thank you! this did work but I will have additional columns as managers are added and would rather not include additional IF statements.
 
Upvote 0
An option for when you have multiple columns. This assumes your data starts in column B.
Book1
ABCDEFGHI
1JamesSarahSydneyHSarah
2AEC
3BFD
4G
5H
Sheet2
Cell Formulas
RangeFormula
I1I1=INDEX($B$1:$F$1,1,MIN(IF($B$2:$F$5=H1,COLUMN($B$1:$F$5)-1)))
OK this seems to do exactly what is needed. I adjusted the end column and it seems to grab all data exactly as needed. Thank you @Cubist
 
Upvote 0

Forum statistics

Threads
1,224,887
Messages
6,181,598
Members
453,055
Latest member
cope7895

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