Nested IF function within an IF/lookup Function

brentcook

Board Regular
Joined
Nov 28, 2016
Messages
78
I need to look for a text value in a list. If it is true then equal a value. If false, look in a different list. If true, return a different value. If false, then return a third value. Is this possible?

Example:

AppleAsparagusT-BoneMeat
OrangeBrussel Sprouts
GrapeSpinach
BananaBroccoli

<tbody>
</tbody>

Explanation:

Unsuccessful Search of Column 1 for Cell D1 leads to unsuccsesful search of column 2 = MEAT.

If found in column 1, then Fruit

If found in column 2, then Vegetable

Any ideas?

Thanks in advance
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Try this:

Code:
=IF(ISNA(VLOOKUP(D1,A1:A4,1,FALSE)),IF(ISNA(VLOOKUP(D1,B1:B4,1,FALSE)),"not found","Vegetable"),"Fruit")
 
Upvote 0
It worked perfectly. Thank you. I spent so long on this and I would never have thought of ISNA( .

One last thing, if the Lookup value had blanks mixed in, would I be able to leave the return value blanks as well?
 
Upvote 0
I should have tried to use my brain instead of going back to your fountain of knowledge. Ignore my last post. I can't thank you enough YKY. I was grasping at straws with this one. It works perfectly. You are a life saver.

Thanks,

Brent
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top