+ Reply to Thread
Results 1 to 13 of 13

Excel formula for multiple criteria

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    Cambridge, MA
    MS-Off Ver
    2010
    Posts
    10

    Excel formula for multiple criteria

    Hi,

    I've been working on creating a single (or minimalist) formula for my spreadsheet.
    Basically, what I've been looking to do is:
    if B1 contains wildcard values one*, *two, three*, *four, then A1 = "low".
    if B1 contains wildcard values five*, *six, *seven, eight*, then A1 = "
    if B1 contains wildcard values nine*, *ten, *eleven, twelve*, then A1 = "high"

    this would then be copied down to all subsequent cells in the same column (containing 8000+ rows)

    I've been unsuccessful in finding a clean way of getting this done. Any help would be much appreciated.

  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,463

    Re: Excel formula for multiple criteria

    Try it like this in A1:

    =IF(ISNUMBER(MATCH(B1,{"one*","*two","three*","*four"},0)),"low",IF(ISNUMBER(MATCH(B1,{"five*","*six","*seven","eight*"},0)),"",IF(ISNUMBER(MATCH(B1,{"nine*","*ten","*eleven","twelve*"},0)),"high","not found")))

    You can change the "not found" to any other message (or just ""), then copy down.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    06-24-2015
    Location
    Cambridge, MA
    MS-Off Ver
    2010
    Posts
    10

    Re: Excel formula for multiple criteria

    everything except the wildcard (*) seems to be working. With asterisk, it just ends up defaulting to "not found"

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,052

    Re: Excel formula for multiple criteria

    what would some samples be of what is baing matched with the wild card?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    06-24-2015
    Location
    Cambridge, MA
    MS-Off Ver
    2010
    Posts
    10

    Re: Excel formula for multiple criteria

    I'd like to add all of these to the match criteria

    ap650
    ap6532
    *lo
    CP-7906G
    CP-7911G
    CP-7925G
    CP-7931G
    CP-7941G
    CP-7942G
    CP-7945G
    CP-7961G
    CP-7962G
    CP-7965G
    CP-7970G
    CP-7975G
    HP Jetdirect
    *ilo
    IOS*
    Lexmark*
    *esx*
    ctx
    NPI*
    OA*
    ZA*

  6. #6
    Registered User
    Join Date
    06-24-2015
    Location
    Cambridge, MA
    MS-Off Ver
    2010
    Posts
    10

    Re: Excel formula for multiple criteria

    ok I had to flip the match cases from Pete_UK's repsonse. Once I did that it worked as expected.

    =IF(ISNUMBER(MATCH({"ap65*","*two","three*","*four"},B1,0)),"low",IF(ISNUMBER(MATCH({"five*","*six","*seven","eight*"},B1,0)),"medium",IF(ISNUMBER(MATCH({"nine*","*ten","*eleven","twelve*"},B1,0)),"high","not found")))

  7. #7
    Registered User
    Join Date
    06-24-2015
    Location
    Cambridge, MA
    MS-Off Ver
    2010
    Posts
    10

    Re: Excel formula for multiple criteria

    the wildcard works now, however the formula is not reading anything past the first criteria (ap65*)

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

    Re: Excel formula for multiple criteria

    Attach a sample workbook, so that we might understand more clearly what you are trying to do. (The FAQ describes how to).

    Pete

  9. #9
    Registered User
    Join Date
    06-24-2015
    Location
    Cambridge, MA
    MS-Off Ver
    2010
    Posts
    10

    Re: Excel formula for multiple criteria

    test_criteria.xlsx

    See attached. I'm trying to label column A (criticality) based on the contents of column B (also column U, but you can ignore this for now)

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

    Re: Excel formula for multiple criteria

    Note that your cell references need adjusting in A2 - some parts of the formula refer to B2 and others to B1 (and even #REF!).

    (This is not the problem, though).

    Pete

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

    Re: Excel formula for multiple criteria

    Try this formula in A2:

    =IF(SUM(COUNTIF(B2,{"ap65*","*lo","CP-79*","HP*","*ilo","IOS*","lexmark*","*ctx*","NPI*","OA*","ZA*","APC*","American Power","netbotz"})),"low",IF(SUM(COUNTIF(B2,{"riverbed","imperva","*esx*"})),"medium",IF(SUM(COUNTIF(B2,{"airdefense","blue coat*"})),"high","not found")))

    then copy down.

    Hope this helps.

    Pete

  12. #12
    Registered User
    Join Date
    06-24-2015
    Location
    Cambridge, MA
    MS-Off Ver
    2010
    Posts
    10

    Re: Excel formula for multiple criteria

    that seems to work pretty well. And you help me better understand the use of the countif function thanks!

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

    Re: Excel formula for multiple criteria

    Glad to hear it.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel Formula: Get the closest value with multiple criteria
    By vinzdd in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 05-14-2015, 11:04 PM
  2. [SOLVED] Multiple criteria SUMPRODUCT (3 criteria) Excel 2003
    By lelrich in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-10-2014, 01:58 PM
  3. Excel 2007 : Index, Match, Large Formula: Multiple Criteria, Multiple Ranges
    By SimpleJack in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-19-2013, 08:54 AM
  4. Replies: 1
    Last Post: 09-17-2012, 05:14 AM
  5. Excel formula for filling column refer to multiple criteria
    By TJTL in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-24-2012, 08:33 PM
  6. Replies: 1
    Last Post: 05-16-2011, 05:00 PM
  7. Replies: 4
    Last Post: 05-16-2008, 02:27 AM

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