Amateurhour35
Amateurhour35

Reputation: 95

excel using 2 lookup columns in vlookup

Basic scenario is I want to use column A2 or B2 to vlookup to a different sheet. A2 and B2 can be different strings, but if either of those match I want to bring in the value from sheet I am looking up to.

The formula below works well if I only care about A2, but the other sheet can have a value that matches either A2 or B2.

Any thoughts on how to modify the formula below so it brings in the lookup value that matches?

=IF('Car Accounts'!A4  ="","",VLOOKUP('Car Accounts'!A4,DCTM!B:B,1,0))

In lamen's terms something like this:

=IF('Car Accounts'!A4  ="","",VLOOKUP('Car Accounts'!**A4 OR B4**,DCTM!B:B,1,0))

Upvotes: 0

Views: 43

Answers (1)

Scott Craner
Scott Craner

Reputation: 152465

use IFFEROR:

=IFERROR(VLOOKUP('Car Accounts'!A4,DCTM!B:B,1,0),VLOOKUP('Car Accounts'!B4,DCTM!B:B,1,0))

Upvotes: 1

Related Questions