# VLOOKUP with IF statement

#### shlomek12

##### Board Regular
What is wrong here?

IF(VLOOKUP(C2,Overrides!\$A\$1:\$F\$70,6,false)),="",VLOOKUP(C2,'Pricing & Availability'!\$A\$1:\$F\$700,6,FALSE),0)

I want to test if the first lookup is getting no results (#n/a"), then I want to use another vlookup

### Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

#### Trevor_S

##### Well-known Member
Try IFERROR and move some brackets:

=IFERROR(VLOOKUP(C2,Overrides!\$A\$1:\$F\$70,6,false),VLOOKUP(C2,'Pricing & Availability'!\$A\$1:\$F\$700,6,FALSE))

If the first lookup is an #N/A it will use the second one.

#### shlomek12

##### Board Regular
Try IFERROR and move some brackets:

=IFERROR(VLOOKUP(C2,Overrides!\$A\$1:\$F\$70,6,false),VLOOKUP(C2,'Pricing & Availability'!\$A\$1:\$F\$700,6,FALSE))

If the first lookup is an #N/A it will use the second one.

Thanks it worked

Now I have another outcome, sometimes it will be "Blank", so if its blank "OR" N/A, I need to use the 2nd vlookup

HOw can I do it ?

#### Trevor_S

##### Well-known Member
Use another IF statement to check for the blank first:
=IF(
VLOOKUP(C2,Overrides!\$A\$1:\$F\$70,6,false)="",
VLOOKUP(C2,'Pricing & Availability'!\$A\$1:\$F\$700,6,FALSE),
IFERROR(VLOOKUP(C2,Overrides!\$A\$1:\$F\$70,6,false),VLOOKUP(C2,'Pricing & Availability'!\$A\$1:\$F\$700,6,FALSE)))

Replies
6
Views
43
Replies
1
Views
32
Replies
2
Views
53
Replies
9
Views
79
Replies
6
Views
71