Using multiple IF Statements

cimajc17

New Member
Joined
Jun 10, 2015
Messages
15
Hey,
I'm trying to use the following if statement to create a category column.
=IF(VLOOKUP(E4,Med,1,FALSE)<>"#N/A","Medical",IF(VLOOKUP(E4,Surgery,1,FALSE)<>"#N/A","Surgery"," "))

But the second statement isn't working. Any suggestion.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
If the #N/A is the standard Excel error (and not literal text), you cannot check/compare it like that.
Try:
Code:
[COLOR=#333333]=IF(ISNA(VLOOKUP(E4,Med,1,FALSE)),"Medical",IF(ISNA(VLOOKUP(E4,Surgery,1,FALSE)),"Surgery"," "))[/COLOR]
 
Upvote 0
Code:
=IF(ISERROR(VLOOKUP(E4,Med,1,FALSE))= FALSE,"Medical",IF(ISERROR(VLOOKUP(E4,Surgery,1,FALSE)) =FALSE,"Surgery"," "))


try it
 
Upvote 0
Hi i try'd it over here. And it should be:

Code:
=IF(VLOOKUP("Med", E4,1,FALSE)<>"#N/A","Medical",IF(VLOOKUP("Surgery",E4,1,FALSE)<>"#N/A","Surgery"," "))

Cheers.
 
Upvote 0
Code:
=IF(VLOOKUP("Med", E4,1,FALSE)<>"#N/A","Medical",IF(VLOOKUP("Surgery",E4,1,FALSE)<>"#N/A","Surgery"," "))
I believe that will only work is "#N/A" is a literal text value that has been entered, and not the #N/A error that formulas sometimes return.
 
Upvote 0
I was trying to add to more categorize but i only get Medical, Surgery categorize.
=IF(ISNA(VLOOKUP(E4,Med,1,FALSE)),"Medical",IF(ISNA(VLOOKUP(E4,Surgery,1,FALSE)),"Surgery",IF(ISNA(VLOOKUP(E4,ICU,1,FALSE)),"ICU",IF(ISNA(VLOOKUP(E4,Transplant,1,FALSE)),"Transplant"," "))))
 
Upvote 0
Can you describe your named ranges (Med, Surgery,ICU, and Transplant), their structure and contents, and what is in E4?
 
Upvote 0
This is what Med looks like and formatted as text :
MED, CARD HEART RHYTHM
MED, CARD ISCHEMIC HEART
MED, CARD VALVE STRUCTURE
MED, CARDIOLOGY 1
MED, CARDIOLOGY 2
MED, CARDIOLOGY 3

This is ICU
MED, CRIT MICU
MED, CRIT MICU 1
MED, CRIT MICU 2

Transplant
TRANSPLANT, KIDNEY/PANCR
TRANSPLANT, LIVER

Surgery
SURG, ORTHO TRAUMA 1
SURG, ORTHO TRAUMA 2
SURG, ORTHO TRAUMA 3
SURG, ORTHO TRAUMA 4

In Column E is a combination all the things in the named ranges

<colgroup><col></colgroup><tbody>
</tbody>

<colgroup><col></colgroup><tbody>
</tbody>

<colgroup><col></colgroup><tbody>
</tbody>

<colgroup><col></colgroup><tbody>
</tbody>
 
Upvote 0
OK. I think I may have designed your formula backwards, as you were originally wanting to check for NOT equal to #N/A, and my formula is checking for #N/A.

Are all these named ranges in the same area (above/below each other), or are the in separate locations? If they are in the same area, you may only need one VLOOKUP, instead of nesting them. Otherwise, I think you will need to modify the formula like this:
Code:
[COLOR=#333333]=IF(NOT(ISNA(VLOOKUP(E4,Med,1,FALSE))),"Medical",IF(NOT(ISNA(VLOOKUP(E4,Surgery,1,FALSE))),"Surgery",IF(NOT(ISNA(VLOOKUP(E4,ICU,1,FALSE))),"ICU",IF(NOT(ISNA(VLOOKUP(E4,Transplant,1,FALSE))),"Transplant"," "))))[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,215,558
Messages
6,125,504
Members
449,235
Latest member
Terra0013

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