Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 177
Default If a cell contains "preferred" then do this

here is what I got =if(a1="*preferred*","B","A")

what do I do to make it work?

thanks... Steve

trying to match partial text in a cell

a1 might have "preferred chimichangas" or "preferred nonsense" for example...
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default If a cell contains "preferred" then do this

One way:

=if(countif(a1,"*preferred*")0,"B","A")

another:
=if(isnumber(search("preferred",a1)),"B","A")

if you want to make it case sensitive, replace "search" with "find".

(=Countif() is not case sensitive)

SteveC wrote:

here is what I got =if(a1="*preferred*","B","A")

what do I do to make it work?

thanks... Steve

trying to match partial text in a cell

a1 might have "preferred chimichangas" or "preferred nonsense" for example...


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 177
Default If a cell contains "preferred" then do this

great. thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default If a cell contains "preferred" then do this

Thank you Dave,

You saved me hours of work!!!!!
I needed the same formula as well!!!



"Dave Peterson" wrote:

One way:

=if(countif(a1,"*preferred*")0,"B","A")

another:
=if(isnumber(search("preferred",a1)),"B","A")

if you want to make it case sensitive, replace "search" with "find".

(=Countif() is not case sensitive)

SteveC wrote:

here is what I got =if(a1="*preferred*","B","A")

what do I do to make it work?

thanks... Steve

trying to match partial text in a cell

a1 might have "preferred chimichangas" or "preferred nonsense" for example...


--

Dave Peterson

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
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Instead of a negative number, I'd like to show zero... Dr. Darrell Excel Worksheet Functions 6 December 7th 05 08:21 PM
Cell color based upon cell value My View Excel Discussion (Misc queries) 11 July 6th 05 03:59 AM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM


All times are GMT +1. The time now is 10:13 PM.

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

About Us

"It's about Microsoft Excel"