#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default If + ISTEXT + SEARCH

I have this formula:

IF(ISNUMBER(SEARCH("A",B10)),"Apple","")

which will return Apple if the string in cell B10 contains A.

What if I want to expand the selection? Meaning if in cell B10, there is a A
or B or C, return Apple?

Cell B10 is something = A, B, C, K, Q


Thanks for your help.
  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: If + ISTEXT + SEARCH

To expand the selection and return "Apple" if cell B10 contains A, B, or C, you can modify the formula using the OR function. Here's how you can do it:
  1. =IF(OR(ISNUMBER(SEARCH("A",B10)),ISNUMBER(SEARCH(" B",B10)),ISNUMBER(SEARCH("C",B10))),"Apple","")

This formula uses the OR function to check if any of the conditions are true. The conditions are the same as the original formula, but we added two more conditions for B and C. If any of these conditions are true, the formula will return "Apple". If none of the conditions are true, the formula will return an empty string ("").

You can also simplify the formula by using the FIND function instead of SEARCH. The FIND function is case-sensitive, so it will only find exact matches. Here's the simplified formula:
  1. =IF(OR(ISNUMBER(FIND("A",B10)),ISNUMBER(FIND("B",B 10)),ISNUMBER(FIND("C",B10))),"Apple","")

This formula works the same way as the previous one, but it uses the FIND function instead of SEARCH.
__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default If + ISTEXT + SEARCH

Try this:

=IF(COUNT(SEARCH({"A","B","C"},B10)),"Apple","")

--
Biff
Microsoft Excel MVP


"mldancing" wrote in message
...
I have this formula:

IF(ISNUMBER(SEARCH("A",B10)),"Apple","")

which will return Apple if the string in cell B10 contains A.

What if I want to expand the selection? Meaning if in cell B10, there is a
A
or B or C, return Apple?

Cell B10 is something = A, B, C, K, Q


Thanks for your help.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default If + ISTEXT + SEARCH

It works!! Thank you very much!!


"T. Valko" wrote:

Try this:

=IF(COUNT(SEARCH({"A","B","C"},B10)),"Apple","")

--
Biff
Microsoft Excel MVP


"mldancing" wrote in message
...
I have this formula:

IF(ISNUMBER(SEARCH("A",B10)),"Apple","")

which will return Apple if the string in cell B10 contains A.

What if I want to expand the selection? Meaning if in cell B10, there is a
A
or B or C, return Apple?

Cell B10 is something = A, B, C, K, Q


Thanks for your help.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default If + ISTEXT + SEARCH

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"mldancing" wrote in message
...
It works!! Thank you very much!!


"T. Valko" wrote:

Try this:

=IF(COUNT(SEARCH({"A","B","C"},B10)),"Apple","")

--
Biff
Microsoft Excel MVP


"mldancing" wrote in message
...
I have this formula:

IF(ISNUMBER(SEARCH("A",B10)),"Apple","")

which will return Apple if the string in cell B10 contains A.

What if I want to expand the selection? Meaning if in cell B10, there
is a
A
or B or C, return Apple?

Cell B10 is something = A, B, C, K, Q


Thanks for your help.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF-ISTEXT formula Cardian Excel Discussion (Misc queries) 6 August 6th 07 04:52 PM
Using ISTEXT across separate Spreadsheets Adrena1in Excel Worksheet Functions 1 June 30th 06 11:23 AM
How can I nest ISTEXT and IF functions? Hyatt2k2 Excel Worksheet Functions 1 June 4th 06 08:51 PM
ISTEXT Micayla Bergen Excel Discussion (Misc queries) 1 May 19th 05 02:13 AM
I need help with a =sum IF ISTEXT formula. I keep getting 0. PullingMyHairOut Excel Discussion (Misc queries) 2 May 6th 05 01:31 PM


All times are GMT +1. The time now is 02:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"