+ Reply to Thread
Results 1 to 8 of 8

If formula where cell contains a range of values

Hybrid View

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    2

    If formula where cell contains a range of values

    Hi

    I am a novice excel user and battling with a formula - extract below where column A "description" contains a range of values (free text), what I want is a formula that will identify whether the text contains certain text eg "DW-EXP", or "AW-EXP" or "DW-DEP", since the text can be anywhere in the text string I am not able to use LEFT/Right etc....I do not want to apply filters as I need to manipulate the data further. Basically I want to return "DW-EXP", or "AW-EXP" or "DW-DEP" in Column D if that is contained within the text string in Col A:

    ColumnA ColumnB ColumnC ColumnD
    Description $ $
    ABC ZXY DW-EXP 123 908 100 200
    ABC ZXY AW-EXP 123 908 100 200
    ABC ZXY DW-DEP 123 908 100 200
    ABC ZXY 123 908 DW-EXP 100 200
    AW-EXP ABC ZXY 123 908 100 200
    AW-EXP ABC ZXY 100 200
    ABC DW-DEP 123 908 100 200
    ABC ZXY DW-DEP 123 908 1234567 100 200
    AW-EXP ABC ZXY 123 908 100 200

    Sure its simple but struggling today!

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

    Re: If formula where cell contains a range of values

    Put this in D2:

    =IF(ISNUMBER(SEARCH("DW-EXP",A2)),"DW-EXP",IF(ISNUMBER(SEARCH("AW-EXP",A2)),"AW-EXP",IF(ISNUMBER(SEARCH("DW-DEP",A2)),"DW-DEP","")))

    then copy down.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-02-2012
    Location
    Baku
    MS-Off Ver
    Excel 2010
    Posts
    273

    Re: If formula where cell contains a range of values

    Here is the answer. Have a look.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: If formula where cell contains a range of values

    You can try the the formual this way.
    Formula: copy to clipboard
    =IF(OR(ISNUMBER(MATCH("*DW-EXP*",A1,0)),ISNUMBER(MATCH("*DW-DEP*",A1,0)),ISNUMBER(MATCH("*AW-EXP*",A1,0))),TRUE,FALSE)

  5. #5
    Registered User
    Join Date
    10-02-2012
    Location
    Baku
    MS-Off Ver
    Excel 2010
    Posts
    273

    Re: If formula where cell contains a range of values

    Quote Originally Posted by Sindhus View Post
    You can try the the formual this way.
    Formula: copy to clipboard
    =IF(OR(ISNUMBER(MATCH("*DW-EXP*",A1,0)),ISNUMBER(MATCH("*DW-DEP*",A1,0)),ISNUMBER(MATCH("*AW-EXP*",A1,0))),TRUE,FALSE)
    Does it give only true or false?

  6. #6
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: If formula where cell contains a range of values

    Oh i missed the last line. This formula returns true/false only. If you want, put the formula structure as Pete_Uk mentioned.
    Formula: copy to clipboard
    =IF(ISNUMBER(MATCH("*DW-EXP*",A1,0)),"DW-EXP",IF(ISNUMBER(MATCH("*DW-DEP*",A1,0)),"DW-DEP",IF(ISNUMBER(MATCH("*AW-EXP*",A1,0)),"AW-EXP",FALSE)))

  7. #7
    Registered User
    Join Date
    10-18-2012
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: If formula where cell contains a range of values

    Thanks for the help :-)

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: If formula where cell contains a range of values

    @ Buchan19

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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