VLOOKUP with IF statement

shlomek12

Board Regular
Joined
Aug 2, 2011
Messages
236
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
 

Some videos you may like

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
Joined
Oct 17, 2015
Messages
614
Office Version
  1. 2016
Platform
  1. Windows
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
Joined
Aug 2, 2011
Messages
236
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
Joined
Oct 17, 2015
Messages
614
Office Version
  1. 2016
Platform
  1. Windows
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)))
 

Watch MrExcel Video

Forum statistics

Threads
1,109,330
Messages
5,528,043
Members
409,799
Latest member
mlewan_ca

This Week's Hot Topics

Top