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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
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,806
Messages
6,121,672
Members
449,045
Latest member
Marcus05

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