Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Vlookup in an if statement

Status
Not open for further replies.

mgbeye

Programmer
May 30, 2001
47
US
We have checked this formula several times, but it still will not work. If the statement is true it returns the 0 which is correct. If it is false it returns #N/A. Does anyone know why. (All cell references are correct)
Code:
=IF(ERROR.TYPE(VLOOKUP(CONCATENATE(A28," Total"),'[7.16-7.22.xls]Sheet1'!$G$2:$I$482,3,FALSE))=7, 0, (VLOOKUP(CONCATENATE(A28," Total"),'[7.16-7.22.xls]Sheet1'!$G$2:$I$482,3,FALSE)))
 
Guess as to the cause: the ERROR.TYPE function returns #N/B if there is no error.

Solution: use ISNA.

With simpeler references to make it easier to read:

=IF(ISNA(VLOOKUP(CONCATENATE(A28,"Total"),G2:I5,3,FALSE)),0, VLOOKUP(CONCATENATE(A28, "Total"),G2:I5,3,FALSE))

IS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top