+ Reply to Thread
Results 1 to 5 of 5

SUMIF with wildcard, need to exclude a criteria

  1. #1
    Registered User
    Join Date
    10-20-2014
    Location
    Austin, Texas
    MS-Off Ver
    2011 Mac
    Posts
    2

    SUMIF with wildcard, need to exclude a criteria

    I am grouping web search results concepts and then counting how many times the concept was searched.
    For example, we grouped together people searching for road conditions but they might have used various search terms like: "road condition", "traffic", "road closure" etc. My problem is that in another concept uses the search term "traffic counts". So for the Road Conditions I want to add when the search term "traffic" (with any additional combination of words) was used but not "traffic counts".

    My current formula is such:
    SUMIF(A:A,"*road condition*",B:B)+SUMIF(A:A,"*traffic*",B:B)+SUMIF(A:A,"*road closure*",B:B)+SUMIF(A:A,"*highway condition*",B:B)+SUMIF(A:A,"*road construction*",B:B)+SUMIF(A:A,"*highway closure*",B:B)+SUMIF(A:A,"*traffic map*",B:B)+SUMIF(A:A,"*road report*”,B:B)

    How do I tell it not to sum instances of "traffic counts"?

    Using Excel 2011 for Mac or 2010 on PC.

    Thanks in advance
    Donna

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

    Re: SUMIF with wildcard, need to exclude a criteria

    Why don't you just subtract that particular condition from what you already have, like this:

    =your_existing_formula - SUMIF(A:A,"traffic counts",B:B)

    Also, you don't really need "*traffic map*" as a condition because "*traffic*" will also count those, so you will get some double-counts.

    Hope this helps.

    Pete

  3. #3
    Valued Forum Contributor
    Join Date
    10-15-2007
    Location
    Home
    MS-Off Ver
    Office 2010, W10
    Posts
    373

    Re: SUMIF with wildcard, need to exclude a criteria

    Hi Donna
    Welcome to the board

    Since you have many conditions, it would maybe be better if you'd use 2 ranges in the worksheet to write the text to be included and excluded.
    This would make the formula easier to read and to maintain.

    For ex.:

    Write "road condition","traffic","road closure","highway condition","road construction","highway closure","road report" in Y1:Y7
    Write "traffic counts","traffic map" in Z1:Z2

    Then use the formula

    =SUMPRODUCT(SUMIF(A:A,"*"&Y1:Y7&"*",B:B))-SUMPRODUCT(SUMIF(A:A,"*"&Z1:Z2&"*",B:B))

  4. #4
    Registered User
    Join Date
    10-20-2014
    Location
    Austin, Texas
    MS-Off Ver
    2011 Mac
    Posts
    2

    Re: SUMIF with wildcard, need to exclude a criteria

    Thank you both for your responses. I'm excited to learn more about excel once I graduate from getting my masters in December I plan to devote much of my new found free time to the task.

    Pete, your response is so easy, I was trying to make it much more complicated. Should always remember to think about a simple solution.

    Iecxe, I really like your response - I can see it making future changes or updates very easy.

    Thank you both for your responses. Always more than one way to skin a cat, as they say.

    Donna

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

    Re: SUMIF with wildcard, need to exclude a criteria

    Glad to be of help, Donna, and thanks for the rep. You can learn a lot about Excel by reading responses to other problems on the Forum.

    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.

    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. Using SUMIF to count certain criteria but exclude others
    By Dan27 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-24-2011, 07:39 AM
  2. Sumif for wildcard character
    By patam in forum Excel General
    Replies: 2
    Last Post: 01-09-2007, 10:05 AM
  3. Wildcard with sumif
    By fractallinda in forum Excel General
    Replies: 8
    Last Post: 02-27-2006, 07:15 PM
  4. Sumif using wildcard
    By claireanddoug in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-22-2005, 06:05 PM
  5. SUMIF, wildcard and cell ref
    By Dave in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-31-2005, 05:06 PM

Tags for this Thread

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