+ Reply to Thread
Results 1 to 10 of 10

Sum of data entries that meet multiple criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    06-29-2016
    Location
    Bristol, UK
    MS-Off Ver
    2010
    Posts
    23

    Sum of data entries that meet multiple criteria

    Hi,

    I am trying to create a formula to add up all entries that match multiple criteria. Currently I am using a "countifs" formula but it doesn't appear to be working (evaluates as 0 when in my test I know it should be 2).

    =COUNTIFS(Table1[Order date],MONTH(Table1[Order date])=1,Table1[System type],"UVX")
    In my spreadsheet I have a table set up which holds the data. What I am trying to get the formula to do is add up the number of entries that match 2 criteria.

    These are:
    • If an entry happened in a certain month (this is in table 1 column "Order date")
    • If an entries type matches a string (this is in table 1 column "System type")

    Thanks for any help!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: Sum of data entries that meet multiple criteria

    Attach the workbook so that we can troubleshoot it.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: Sum of data entries that meet multiple criteria

    This syntax is wrong:

    =COUNTIFS(Table1[Order date],MONTH(Table1[Order date])=1,Table1[System type],"UVX")

    Should be:

    =COUNTIFS(MONTH(Table1[Order date]),1,Table1[System type],"UVX")

  4. #4
    Registered User
    Join Date
    06-29-2016
    Location
    Bristol, UK
    MS-Off Ver
    2010
    Posts
    23

    Re: Sum of data entries that meet multiple criteria

    Thanks for the reply!

    Using that formula, I get a message that the formula contained an error but I don't see where...
    Attached Files Attached Files

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: Sum of data entries that meet multiple criteria

    Try this:

    =COUNT(IF(MONTH(Table1[Order date])=1,IF(Table1[System type]="UVX",Table1[Order date])))

  6. #6
    Registered User
    Join Date
    06-29-2016
    Location
    Bristol, UK
    MS-Off Ver
    2010
    Posts
    23

    Re: Sum of data entries that meet multiple criteria

    That worked a treat! Thanks!

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Sum of data entries that meet multiple criteria

    maybe try this: =SUMPRODUCT((Table1[System type]="UVX")*(MONTH(Table1[Order date])=1))

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: Sum of data entries that meet multiple criteria

    You're welcome!

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

  9. #9
    Registered User
    Join Date
    06-29-2016
    Location
    Bristol, UK
    MS-Off Ver
    2010
    Posts
    23

    Re: Sum of data entries that meet multiple criteria

    Now that I have completed my spreadsheet, it seems that if all the data inside the table is removed, the formula evaluates as 1 regardless.

    I believe it is something to do with how the month formula works and returns false which equates to 1 for some reason?

    Any ideas?
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,869

    Re: Sum of data entries that meet multiple criteria

    See if the following is of any help:
    1) Paste the following into cell C2 on the Stats sheet:
    Formula: copy to clipboard
    =SUMPRODUCT((MONTH(Table1[[Order date]:[Order date]])=ROW(1:1))*(Table1[[System type]:[System type]]=C$1))

    2) Drag the fill handle over to cell G2,
    3) While C2:G2 is still selected double click the fill handle of cell G2,
    4) Paste the following into cell B2 on the Stats sheet: =SUM(C2:G2)
    5) Double click the fill handle of cell B2.
    Let us know if you have any questions/problems.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Returning data for entries that meet a criteria
    By BWellman in forum Excel General
    Replies: 2
    Last Post: 08-27-2015, 12:43 AM
  2. Counting entries in a table which meet date criteria
    By Big Chris in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-24-2014, 04:29 AM
  3. Replies: 10
    Last Post: 03-04-2013, 09:02 AM
  4. [SOLVED] I need a formula that counts how many entries there are that DONT meet a certain criteria
    By VivatMartin in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-23-2012, 08:53 AM
  5. Last N entries thet meet criteria
    By gunnar_ in forum Excel General
    Replies: 13
    Last Post: 04-26-2011, 12:34 PM
  6. How to count unique entries that meet two criteria
    By Gooford in forum Excel General
    Replies: 2
    Last Post: 11-23-2010, 12:13 PM
  7. Counting unique entries that meet certain criteria
    By andy_ag08 in forum Excel General
    Replies: 2
    Last Post: 10-07-2009, 09:21 AM

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