Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If, contains (2003 (SP2))

    Done this before (sometime ago though) & I can neither remember how to do it nor find it. It being using the IF function, where the logical condition is 'contains' e.g. cell A1 contains the letter U. Fun would be true & fin would be false.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: If, contains (2003 (SP2))

    Excel has two functions for this: FIND is case-sensitive, and SEARCH is not case-sensitive. Both will return a number if the search text is found, and an error value if not. So you can use a formula like this:
    <code>
    =IF(ISNUMBER(SEARCH("u",A1)),"Yes","No")
    </code>
    If you want to search for "u" only, not "U", use FIND instead of SEARCH.

  3. #3
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If, contains (2003 (SP2))

    Oops, too late. I'd figured out a method & you'd replied. Anyway, here's my solution (slightly different uses 2 functions);

    =IF((COUNTIF(A2,"*u*"))>0,"Yes","No")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •