If statements

F

forefun

Version: 2008
Operating System: Mac OS X 10.4 (Tiger)
Processor: Power PC

I have a workbook that contains descriptions (of products/styles). Some descriptions contain a notation to denote it being discontinued. It is an asterisk at the end of the description. I am trying to create a column of cells with a formula that will return the phrase "DISC" if the description contains an asterisk. If there is no asterisk, I am using "NO".
Here is what I have been unsuccessfully using:
IF(ISNUMBER(SEARCH("*",C3)),("DISC","N")
 
C

Carl Witthoft

Version: 2008
Operating System: Mac OS X 10.4 (Tiger)
Processor: Power PC

I have a workbook that contains descriptions (of products/styles). Some
descriptions contain a notation to denote it being discontinued. It is an
asterisk at the end of the description. I am trying to create a column of
cells with a formula that will return the phrase "DISC" if the description
contains an asterisk. If there is no asterisk, I am using "NO".
Here is what I have been unsuccessfully using:
IF(ISNUMBER(SEARCH("*",C3)),("DISC","N")

Sorry to start out with RTFM, but this is clearly stated in the Help
file for SEARCH:

"if you want to find a wildcard character such as "*" or "?" you need
to preface it with a tilde"

hence:

=if(isnumber(search("~*",C3),"oh joy","fooey")

BTW I assume the parenthesis before "DISC" in your post was a typo.

And, on a personal note :), why the *^@#(@!^ can't Excel use a
backslash as an escape char just like nearly every other program in
existence, including Word?
 
F

forefun

well, if you are apologizing right off the bat, maybe you shouldn't start out with RTFM. I am not a noob!
I have tried this formula and it still does not return anything other than the formula itself. It doesn't beep at me, it just moves to the next cell, leaving the formula staring me in the face. Using the Formula Builder has proven quite useless as well.
 
J

JE McGimpsey

well, if you are apologizing right off the bat, maybe you shouldn't start out
with RTFM. I am not a noob!

That wasn't particularly obvious from your post, especially since you
did not start out your formula with an equals sign. Leaving that out
will enter your 'formula' as text.

The unmatched parenthesis also was a bit strange.
I have tried this formula and it still does not return anything other than
the formula itself. It doesn't beep at me, it just moves to the next cell,
leaving the formula staring me in the face. Using the Formula Builder has
proven quite useless as well.

If you're seeing the formula (with the equals sign), it's very likely
your cell is formatted as Text, so XL doesn't parse it as a formula.
Reformat the cell as General and reenter the formula.

An alternate explanation is that you may have turned on the preference
to view formulae (Preferences/View/Show formulas checkbox), which you
may have inadvertently turned on using CTRL-~.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Using the FIND feature 1
Trend Lines 2
Using Excel to 'map' two databases 1
Excel 5
How To Edit Pie Chart Legend Labels? 4
Only Mac Word opens 0
Excel 2
Purchase Excel 2004 0

Top