View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default Conditional Formatting

Thanks! When search is successful, it returns a number, when it's not, kicks
out an error. Another method that was possible:

NOT(ISERROR(SEARCH("x",A2")))

Rather than use an extra arguement, I just went with the ISNUMBER.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"EricG" wrote:

Luke,

Very similar to what I just came up with. I'm just a little too slow!
Here's my version (again, using the "FORMULA IS" in the dropdown):

=IF(AND(ISERROR(SEARCH("X",A1,1)),ISERROR(SEARCH(" Y",A1,1))),0,IF(OR(ISERROR(SEARCH("(",A1,1)),ISERR OR(SEARCH(")",A1,1))),1,0))=1

Yours is more compact and elegant.

Out of curiousity - why the switch from ISNUMBER to ISERROR?

Regards,

Eric

"Luke M" wrote:

Format-Conditional Formatting. Change first dropdown to "formula is". Input:

=AND(OR(ISNUMBER(SEARCH("y",A2)),ISNUMBER(SEARCH(" x",A2))),ISERROR(SEARCH("(",A2)),ISERROR(SEARCH(") ",A2)))

Click Format, Pattern, select red. Hit "ok", then "ok" again.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"lightbulb" wrote:

I'm trying to set the conditional formatting so that if a cell contains X or
Y but does not have a begining and end parenthesis, it will turn red. How do
I do this?