IF with many conditions

sburkhar

Active Member
Joined
Oct 4, 2006
Messages
363
I need to write a formula that states:

If the cell is empty then nothing
if it contains "terminal" then "Term"
if it contains "wire"" then "wire"
if it contains anything else then "other".

but the cell will contain something like this:

70031171 Terminal;BC;Press/Lug/Tab/Pipe

so the formula will need to select the word "Terminal" out of the string of words to return "term" "wire" or "other"
Excel 2003
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try:

=IF(A1="","",IF(ISNUMBER(SEARCH("Terminal",A1)),"Term",IF(ISNUMBER(SEARCH("Wire",A1)),"Wire","Other"))
 
Upvote 0
crap! I spoke too soon.
I should mention that the reference cell has a formula in it, so even though it LOOKS empty, it's returning "other".
 
Upvote 0
crap! I spoke too soon.
I should mention that the reference cell has a formula in it, so even though it LOOKS empty, it's returning "other".

so is the formula returning a space perhaps? " " in the formula? or is it "" in the formula
 
Upvote 0
This is what's in the reference cell:
='CHANGE MATRIX '!E26

It's pulling a concatenated formula from another page.
 
Upvote 0
I think I can do this another way. I've created a VLOOKUP for the "Term" and "Other" results.
However, If the cell is populated and the VLOOKUP does not return "Term" or "Other" I need it to return "Wire".
Is this possible?

Or if it detects 180 or 181 at the beginning of the Part Number it should return "Wire"
 
Last edited:
Upvote 0
MrKowz,

I ran the formula through the evalator and see that having Terminal in A1 generated a 1 so returned Term....why does it return a 1?
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,682
Members
452,937
Latest member
Bhg1984

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