Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community
SOLVED

Combine IF(Vlookup and IFERROR(Vlookup

Copper Contributor

Is it possible to combine the two vlookup formulas listed below?  I have tried so many different ways with no success. I am using Microsoft Excel 2016. 

 

Some of the data will have costs more or less than $0 and some will have a cost equal to $0.  Unfortunately some of the data being looked up from one sheet will not be listed in the lookup sheet. So I need the iferror to have a result of "No Data".  But if the Lookup Value (column A) does exist and is equal to 0 then the result needs to state "Cancelled".  For all other costs the result will be "Valid".  There will be no blank data.  Thank you for your help.

 

=IFERROR(VLOOKUP($A2,Sheet2!$A:$C,2,0),"No Data")

and

=IF(VLOOKUP($A2,Sheet2!$A:$C,2,0)=0,"Cancelled","Valid")

 

5 Replies
best response confirmed by 2Dogs6 (Copper Contributor)
Solution

@2Dogs6 

=IFERROR(IF(VLOOKUP($A2,Sheet2!$A:$C,2,0)=0,"Cancelled","Valid"),"No Data")

 

Does this return the intended results?

@2Dogs6 

Perhaps

=IFNA( IF(VLOOKUP($A1,Sheet2!$A:$C,2,0)=0,"Cancelled","Valid"), "No Data" )
I knew it was an easy answer just couldn't get anything to show up in a google search. This worked perfectly. Thank you.
This one worked perfectly as well. Thank you.

@2Dogs6 , you are welcome

1 best response

Accepted Solutions
best response confirmed by 2Dogs6 (Copper Contributor)
Solution

@2Dogs6 

=IFERROR(IF(VLOOKUP($A2,Sheet2!$A:$C,2,0)=0,"Cancelled","Valid"),"No Data")

 

Does this return the intended results?

View solution in original post