Reputation: 13
I'm trying to run a report that pulls information from various tables. I've created the below nested if function in Excel 2013 but am finding that it's not running correctly and I'm looked over it to the point that I'm stumped.
The top line with "WAGE" runs correctly and returns the correct information. The bottom line with "TAX" only returns false when. If I switch them around by inserting "tax" in the wage field and vise versa, tax will pull and wage returns false, so I'm fairly sure the error/issue in my logic is in the 2nd line. Can anyone please tell me what I'm doing wrong? Thanks!
=IF(RIGHT(B3,4)="WAGE",VLOOKUP(A3,'Tax010'!$A$2:$R$5000,16,IF(RIGHT(B3,3)="TAX",VLOOKUP(A3,'Tax010'!$A$2:$R$5000,17,FALSE)))
Upvotes: 1
Views: 62
Reputation: 12113
This should fix your problem:
=IF(RIGHT(B3,4)="WAGE",VLOOKUP(A3,'Tax010'!$A$2:$R$5000,16,FALSE),IF(RIGHT(B3,3)="TAX",VLOOKUP(A3,'Tax010'!$A$2:$R$5000,17,FALSE)))
As mentioned in the comments, you must close your first VLOOKUP
with 16,False)
or equivalently 16,0)
Upvotes: 1