Multiple column lookup or index/match formula

londa_vba

Board Regular
Joined
May 11, 2023
Messages
61
Office Version
  1. 365
Platform
  1. Windows
Hello
I am trying to accomplish the following:
On active sheet "B", I would like to reference "$B2" and search for where this cell value is found on sheet "A" which will either be in column B or C and every time I would like the result in sheet "A" column D that corresponds the answer should display on sheet B column C. The match needs to be exact and there will be times where D result is blank. I can get it to work when the lookup area is only one column but two columns is stumping me. Sorry if this is confusing.

Sheet A
HeaderHeaderAnswer I am seeking
11-Ydog
22-Ydog
33-Ycow
4-RB4-RB-Y
55-Yfish
6-RB6-RB-Y

Sheet B
Column to pull referenceResults go here
1
3
4-RB
6
1-Y
4-RB-Y
5-Y
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Sheet A:
Libro1
ABCD
1HeaderHeaderAnswer I am seeking
211-Ydog
322-Ydog
433-Ycow
54-RB4-RB-Y
655-Yfish
76-RB6-RB-Y
8
Sheet A


Sheet B:
Libro1
ABC
1Column to pull referenceResults go here
21dog
33cow
44-RB0
56Not exists
61-Ydog
74-RB-Y0
85-Yfish
Sheet B
Cell Formulas
RangeFormula
C2:C8C2=IFERROR(VLOOKUP(B2,'Sheet A'!B:D,3,0),IFERROR(VLOOKUP(B2,'Sheet A'!C:D,2,0),"Not exists"))
 
Upvote 1
Solution
Or this:

Excel Formula:
=LET(a,B2:B8,d,'Sheet A'!D:D,IFERROR(IFERROR(XLOOKUP(a,'Sheet A'!B:B,d),XLOOKUP(a,'Sheet A'!C:C,d)),"Not exists"))
 
Upvote 0
Excel Formula:
=LET(a, XLOOKUP(B2:B8,TOCOL(SheetA!B2:C7),VSTACK(SheetA!D2:D7,SheetA!D2:D7),""), IF(a=0,"",a))
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

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