0

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))

1 Answer 1

1

use IFFEROR:

=IFERROR(VLOOKUP('Car Accounts'!A4,DCTM!B:B,1,0),VLOOKUP('Car Accounts'!B4,DCTM!B:B,1,0))
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks this definitely works just wondering, if I wanted to just make the result be blank if A4 is blank, do you know how to work that in? I Tried putting an if statement around the iferror but it fails: Currently what happens is it runs and displays error when there's not data to lookup with In other words if i put if (expression above, "","") it doesn't do what I would expect it to
=IF('Car Accounts'!A4 ="","",IFERROR(VLOOKUP('Car Accounts'!A4,DCTM!B:B,1,0),VLOOKUP('Car Accounts'!B4,DCTM!B:B,1,0)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.