Index Match formula with 2 matches

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
888
Office Version
  1. 365
Platform
  1. Windows
Hello,

I was wondering if someone could help me with a formula.

I frequently use the following Index Match formula:

=INDEX(P:P,MATCH(C2,O:O,FALSE))

if C2 matches a value in column O it will return the corresponding value in P.

What I would like to do is have 2 matches.

return the value in P if C2 matches the value in O AND if I2 matches the value in column Q,

aka =INDEX(P:P,MATCH(C2,O:O,FALSE) AND MATCH(I2,Q:Q,FALSE)

Is there a way to do this?

Thank you to anyone who can help

Carla
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
It turns out I need 3 matches, but I modified your formula to account for this and it appears to be working great!

=INDEX(P:P,MATCH(C3&"|"&I3&"|"&A3,INDEX(O:O&"|"&Q:Q&"|"&N:N,0),0))

Thank you very much!! :)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Out of curiosity, what does "|" mean?
I have never seen this in a formula before
 
Upvote 0
As a side note, if you're trying to return a number, then you can use SUMIFS like so:

=SUMIFS(P:P,O:O,C3,Q:Q,I3,N:N,A3)
 
Upvote 0
Out of curiosity, what does "|" mean?
It's simply a separator to ensure that you don't get incorrect results.
with this sample & no separator, they would all be considered the same value
+Fluff New.xlsm
ABCD
1SeparatorNo separator
2abcdefabc|defabcdef
3abcdefab|cdefabcdef
4abcdefabcd|efabcdef
Main
Cell Formulas
RangeFormula
C2:C4C2=A2&"|"&B2
D2:D4D2=A2&B2
 
Upvote 0
Guys, you can now use the formula XLOOKUP in the latest office 365. Easier and nicer than Index Match as it also has more options... please look at it
 
Upvote 0
It's simply a separator to ensure that you don't get incorrect results.
with this sample & no separator, they would all be considered the same value
+Fluff New.xlsm
ABCD
1SeparatorNo separator
2abcdefabc|defabcdef
3abcdefab|cdefabcdef
4abcdefabcd|efabcdef
Main
Cell Formulas
RangeFormula
C2:C4C2=A2&"|"&B2
D2:D4D2=A2&B2

So in relation to my formula, without the separator it would combine all the data from the 3 cells and look for it as a group?
Am I understanding this correct?

Thank you so much for the brief lesson, I have a lot to learn.

I memorize formulas and VBA code, know which ones do what but I lack a full understanding of how some of them work
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,234
Members
449,092
Latest member
SCleaveland

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