Reputation: 3
Table 1 Table 2
A B C D
abc 9 abc No
hij 0 def yes
hij No
input output
abc 9
def #N/A
hij No
I have two tables. If the value exists in column A and the lookup value is greater than 0, then lookup in Table 1, else lookup in Table 2. I have tried with the formula:
=IF(OR(ISERROR(VLOOKUP(A7,$A$2:$B$4,2,FALSE)),ISERROR(VLOOKUP(A7,$A$2:$B$4,2,FALSE)=0),VLOOKUP(A7,$A$2:$B$4,2,FALSE)=0),VLOOKUP(A7,$D$2:$E$4,2,FALSE),VLOOKUP(A7,$A$2:$B$4,2,FALSE))
Thanks for any help.
Upvotes: 0
Views: 159
Reputation: 152450
use this formula:
=IF(IFERROR(VLOOKUP(A7,$A$2:$B$4,2,0),0)>0,VLOOKUP(A7,$A$2:$B$4,2,0),VLOOKUP(A7,$C$2:$D$4,2,0))
Upvotes: 3