+ Reply to Thread
Results 1 to 4 of 4

an expression in IF theory that works based on cells containing part (not whole)of a value

  1. #1
    Registered User
    Join Date
    04-18-2012
    Location
    birmingham england
    MS-Off Ver
    2010
    Posts
    63

    an expression in IF theory that works based on cells containing part (not whole)of a value

    hi

    this is a really little thing, but I just cant find the answer anywhere

    our company initial is TP, but sometimes it might be combined with a reference number, e.g TP5659
    I would like the IF formula to stick pick this up..

    I know if it was just the phrase 'TP' I would use =If(a1="tp"...
    how do I express that I would like my If formula to work when something 'contains', not an 'exact match'

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: an expression in IF theory that works based on cells containing part (not whole)of a v

    One way

    =IF(ISNUMBER(SEARCH("tp",A1)),"yes","no")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,695

    Re: an expression in IF theory that works based on cells containing part (not whole)of a v

    You can do it like this:

    =IF(ISNUMBER(SEARCH("tp",A1)), ... etc.

    SEARCH is not case-sensitive (use FIND instead if that is important to you), and the formula will return a TRUE result if the letters tp occur anywhere in A1.

    You can also use COUNTIF with wildcard characters:

    =IF(COUNTIF(A1,"tp*")>0, ... etc

    or

    =IF(COUNTIF(A1,"*tp*")>0, ... etc

    The first one will only find tp if it is at the beginning of A1, whereas for the second one tp could occur anywhere.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    04-18-2012
    Location
    birmingham england
    MS-Off Ver
    2010
    Posts
    63

    Re: an expression in IF theory that works based on cells containing part (not whole)of a v

    Hay.

    both of these worked a treat.
    you people make it look SO easy,
    thanks for your help!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1