Help with VLOOKUP multiple columns formula

Arinoum

Board Regular
Joined
Sep 28, 2016
Messages
64
Hi,
I am trying to write a formula that looks up a value in several columns and if it matches give the result from the column next to it. The formula goes in column A and should be something like this: If B2=a value found in columns C, E or G then give the result that's in the column next to it which should be columns D,F or H. This is what I have so far but I know it's wrong =If(b1=vlookup(b1,C:H,{3,5,7} then give the result shown in the same row as the value but on the next column which should be columns 4,6,8. Based on the below table the result for the first row should be 1 and for the second should be 0.
Please help! Thank you.


FormulaA120A12933A1201A1212
FormulaA122A1220A17712A1231
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
You probably want to check out INDEX MATCH

 
Upvote 0
If you're returning a numeric value, it's pretty easy:

Book1
ABCDEFGH
1
21A120A12933A1201A1212
30A122A1220A17712A1231
433A129
5
Sheet19
Cell Formulas
RangeFormula
A2:A4A2=SUMIF($C$2:$G$3,B2,$D$2:$H$3)


If you're returning text, it's a bit tougher.
 
Upvote 0
If you're returning a numeric value, it's pretty easy:

Book1
ABCDEFGH
1
21A120A12933A1201A1212
30A122A1220A17712A1231
433A129
5
Sheet19
Cell Formulas
RangeFormula
A2:A4A2=SUMIF($C$2:$G$3,B2,$D$2:$H$3)


If you're returning text, it's a bit tougher.
It's not always numerical. There are some letters and numbers in the return value.
 
Upvote 0
You probably want to check out INDEX MATCH

From what I've seen I can match one column at a time. I have several columns and they are not all in the same range. I'm not sure how to use this formula in my case.
 
Upvote 0
It's not always numerical. There are some letters and numbers in the return value.
In that case, here's another option:

Book1
ABCDEFGH
1
21A120A12933A1201A121testing
30A122A1220A17712A1231
433A129
5testingA121
6
Sheet19
Cell Formulas
RangeFormula
A2:A5A2=IFERROR(INDIRECT(TEXT(MIN(IF(($C$2:$G$3=B2)*(MOD(COLUMN($C$2:$G$3)-COLUMN($C$2),2)=0),ROW($C$2:$G$3)*100+COLUMN($C$2:$G$3)+1)),"R00C00"),0),"No match")
Press CTRL+SHIFT+ENTER to enter array formulas.


If you have Excel 365 (you might want to update your member profile), I might be able to come up with something a bit simpler.
 
Upvote 0
In that case, here's another option:

Book1
ABCDEFGH
1
21A120A12933A1201A121testing
30A122A1220A17712A1231
433A129
5testingA121
6
Sheet19
Cell Formulas
RangeFormula
A2:A5A2=IFERROR(INDIRECT(TEXT(MIN(IF(($C$2:$G$3=B2)*(MOD(COLUMN($C$2:$G$3)-COLUMN($C$2),2)=0),ROW($C$2:$G$3)*100+COLUMN($C$2:$G$3)+1)),"R00C00"),0),"No match")
Press CTRL+SHIFT+ENTER to enter array formulas.


If you have Excel 365 (you might want to update your member profile), I might be able to come up with something a bit simpler.
It worked! Thank you so much! :)
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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