Consulting

Results 1 to 6 of 6

Thread: Solved: Wildcards

  1. #1
    VBAX Tutor
    Joined
    Nov 2007
    Posts
    291
    Location

    Solved: Wildcards

    This may seem like a really basic question but I have an IF statement in excel that goes like :-

    =IF(B2="TMI*",1,0)

    but it isnt finding TMI-New York

    Does anyone know why not?

    Thanks

  2. #2
    VBAX Mentor tpoynton's Avatar
    Joined
    Feb 2005
    Location
    Clinton, MA
    Posts
    399
    Location
    I'm not sure how to implement wildcards in a formula like that, but this should work

    =IF(LEFT(B2, 3) = "TMI",1,0)

  3. #3
    Excel formula interpret all sting values literally so TMI* <> TMIanything
    2+2=9 ... (My Arithmetic Is Mental)

  4. #4
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    You could use:

    =COUNTIF(B2,"TMI*")
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Quote Originally Posted by unmarkedhelicopter
    Excel formula interpret all sting values literally so TMI* <> TMIanything
    Not quite true.

    Yes an IF formula will look for an exact match but COUNTIF or SUMIF can be used with wildcards.

  6. #6
    I didn't know that, thanks rory & Norie.
    2+2=9 ... (My Arithmetic Is Mental)

Posting Permissions

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