Coutif and isnumber functions for text

Dryver14

Well-known Member
Joined
Mar 22, 2010
Messages
2,396
Good afternoon,

I was looking at some answers given earlier and think both formulas could be dangerous given long sentences

=IF(A1="","",IF(ISNUMBER(SEARCH("Terminal",A1)),"Term",IF(ISNUMBER(SEARCH("Wire",A1)),"Wire","Other"))

the other formula was countif with *Terminal* as part of the equation,

Having played with both formulas they return the correct result if part of the word is there eg: Term

Is there a safe lookup for words or are these formulas based on searching one cell for a return value?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I'm just learning Texasalynn,

I often take away the question someone has posted and the answers given and see how it works, I just found these answers kind of "Volotile" but I can see the benefit if the question is with regard to 1 of a few responces in a cell


Regards,
Kev
 
Upvote 0
I'm just learning Texasalynn,

I often take away the question someone has posted and the answers given and see how it works, I just found these answers kind of "Volotile" but I can see the benefit if the question is with regard to 1 of a few responces in a cell


Regards,
Kev
When doing these types of lookups there's a chance of getting "false positives".

It depends on the data and knowing what the data is used for.

The search string may be part of another word like this. You want to find the whole separate word "good".

A1: John Goodman did a fine job.

In this case you get a "false positive" because the formula found "good" but it was part of another word.

ISNUMBER(SEARCH("good",A1)) = TRUE

One way to make it somewhat more robust (but not completely) when doing whole word matching is to concatenate space characters to the search string and the string being searched.

A1: John Goodman did a fine job.

ISNUMBER(SEARCH(" good "," "&A1&" ")) = FALSE

However, this fails if there might be punctuation marks present.

A1: Ice cream is so good!

ISNUMBER(SEARCH(" good "," "&A1&" ")) = FALSE
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,787
Members
452,942
Latest member
VijayNewtoExcel

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