+ Reply to Thread
Results 1 to 12 of 12

Count values based on multiple checks

  1. #1
    Registered User
    Join Date
    11-12-2007
    Location
    Dordrecht, Netherlands
    MS-Off Ver
    2016
    Posts
    35

    Count values based on multiple checks

    In addition to my previous post, I have another requirement to add to the formula.

    I would like to sum all values based on the "month" as well as the "Part" column (see attached).
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Count values based on multiple checks

    In D2 and copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In D8 and copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    BSB

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

    Re: Count values based on multiple checks

    Your 10 July column header is not 2018 - it's 2002 - so the correct answer is 13. That aside, you are missing a criterion:

    =SUMPRODUCT((MONTH(H$1:K$1)=C2)*(YEAR(H$1:K$1)=2018)*(H$2:K$8)*(Table1[Part]=$B$2))
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    01-03-2011
    Location
    Bangalore, India
    MS-Off Ver
    MS Excel 2010
    Posts
    49

    Re: Count values based on multiple checks

    For your sumproduct formula add this as well.... *(Table1[Part]=$B$2). I tried it and giving correct results

  5. #5
    Forum Contributor
    Join Date
    08-14-2018
    Location
    Hanoi, Vietnam
    MS-Off Ver
    2016
    Posts
    118

    Re: Count values based on multiple checks

    Try this
    D2=SUMPRODUCT(($G$2:$G$8=$B$2)*($H$2:$K$8)*(MONTH($H$1:$K$1)=C2))
    D8=SUMPRODUCT(($G$2:$G$8=$B$8)*($H$2:$K$8)*(MONTH($H$1:$K$1)=C8))

    Adding criteria for year if you want.
    Last edited by congnt92; 08-29-2018 at 02:44 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Count values based on multiple checks

    Please note that most of the solutions offered have the YEAR criterion missing.

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Count values based on multiple checks

    Quote Originally Posted by AliGW View Post
    Please note that most of the solutions offered have the YEAR criterion missing.
    Morning Ali. Merely me being pedantic (again), but the provided solutions you refer to will replicate the OP's "expected results" so perhaps the year criteria was part of the issue...

    I'll get back in my box

    BSB

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

    Re: Count values based on multiple checks

    The year criterion was not the reason for the very high value returned - that was due to missing the fourth criterion. The year is, I am convinced, a mistake in the header, which the OP assumes is also 2018 (look at the colour coding we were given for guidance).

    You can get out of your box again now.

  9. #9
    Registered User
    Join Date
    11-12-2007
    Location
    Dordrecht, Netherlands
    MS-Off Ver
    2016
    Posts
    35

    Re: Count values based on multiple checks

    Very perceptive of you, didn't notice Thanks for the solution, that was indeed simpler then I anticipated. Is my assumption correct in the fact that any additional validation can just be added in the formula?

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Count values based on multiple checks

    Within reason, yes.

    Are you confirming that I was right about the year? Just want to know so that I can gloat a bit ...

  11. #11
    Registered User
    Join Date
    11-12-2007
    Location
    Dordrecht, Netherlands
    MS-Off Ver
    2016
    Posts
    35

    Re: Count values based on multiple checks

    haha, not sure if it was 2002, but i was definitely not 2018. And regarding the other solutions; yes, yours was the best (and easiest ). So gloat away!

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Count values based on multiple checks

    Tada! Back of the net ...

    Thanks for marking the thread as solved.

+ 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. Count Unique Values based on multiple criterias
    By Dahlia in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-10-2016, 09:10 AM
  2. Count unique values based on multiple criteria
    By Jonathan11235 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-19-2015, 10:02 PM
  3. Count based on column containing multiple values
    By kilbey252 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-19-2015, 02:37 PM
  4. [SOLVED] Count unique values based multiple criterias
    By Petter120 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-03-2014, 03:07 AM
  5. Count based on multiple colum values
    By robin_108 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-09-2012, 11:56 AM
  6. Need to be able to count based on multiple values
    By bhodge10 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-10-2011, 03:56 PM
  7. [SOLVED] how do i count values based on multiple criteria
    By sean in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-16-2009, 02:04 PM

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