+ Reply to Thread
Results 1 to 10 of 10

Complex Count

Hybrid View

  1. #1
    Registered User
    Join Date
    02-07-2008
    Posts
    5

    Complex Count

    Good Morning Exceler's, I have a bit of a complex count I would like help with.

    I have a data-set which is used to track individuals on a daily basis.
    Row 2 comprises of calendar dates, $E$2:$AM$2 Under these dates (in each row) is recorded a specific numerical value, or left blank
    Column C: records the individuals school grade $c$4:$C$320

    What I need to do is to count the number of rows in C which meet the following criteria, for instances = 5, BUT also match a particular month from row 2 (i.e. September) AND have a value greater than 0 recorded in the rows below the particular month (dates)

    I have attached a sample dataset

    Thank-you for any help

    Andrew
    Attached Files Attached Files

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Complex Count

    Try
    =sumproduct(($c$4:$c$320=5)*(month($e$2:$am$2)=9)*($e$4:$am$320>0))
    =sumproduct(($c$4:$c$320=5)*(month($e$2:$am$2)=9)*($e$4:$am$320>0))
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Complex Count

    What does instances=5 mean?
    The Grade =5? Then say the Grade =5

    Use SUMPRODUCT
    Try
    =SUMPRODUCT((C4:C32=5)*(MONTH(E2:AM2)=9)*(E4:AM32>0))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    02-07-2008
    Posts
    5

    Re: Complex Count

    Thankyou for your feedback, I had already tried this sumproduct formula, but unfortunately it gives a total count.
    =SUMPRODUCT((C4:C32=5)*(MONTH(E2:AM2)=10)*(E4:AM32>0)) would equal 80 which is the total sum of all parts.
    Apologies if I wasn't clear enough but what I am after is the total number of occurrences that "5" ( C4:C32) appears when both other conditions are met, i.e. the right month and the corresponding rows below this are not blank.

    Thanks Again
    Andrew

  5. #5
    Registered User
    Join Date
    02-07-2008
    Posts
    5

    Re: Complex Count

    Thankyou for your feedback, I had already tried this sumproduct formula, but unfortunately it gives a total count.
    =SUMPRODUCT((C4:C32=5)*(MONTH(E2:AM2)=10)*(E4:AM32>0)) would equal 80 which is the total sum of all parts.
    Apologies if I wasn't clear enough but what I am after is the total number of occurrences that "5" (C4:C32) appears when both other conditions are met, i.e. the right month and the corresponding rows below this are not blank.

    Thanks Again
    Andrew

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,043

    Re: Complex Count

    It would be helpful to know what your expected result is for the given constants, i.e. grade = 5, month = October and E4:AM32 not blank.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    02-07-2008
    Posts
    5

    Re: Complex Count

    Using the attached Complex Count.xlsx file the required answer should be total of 5. That is
    1. There are 5 occurrences appearing in the Grade Column which are = 5 (C4:C32=5)
    2. That are also have a value greater than 0 within the E4:AM32 range under the month of October (MONTH(E2:AM2)=10)

    If we wrote the same formula but looking at Grade 7 then the answer should be 3

    As I progress through the year, more students will join the program which means if I did a simple count looking for all 'Grade 7's' for instance the generated report would not be able to reflective of the month they started.

    Thanks
    Andrew

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,043

    Re: Complex Count

    This solution uses a helper column, which may be moved/hidden for aesthetic purposes. The formula for the helper column (XFC) is:
    Formula: copy to clipboard
    =AND(C4=AP$1,SUMPRODUCT((E4:AO4)*(MONTH(E$2:AO$2)=AR$1))>0)
    AP1 is the cell that holds the grade number and AR1 is the cell that holds the month number.
    The formula that gives the count is:
    Formula: copy to clipboard
    =COUNTIFS(XFC4:XFC32,TRUE)
    Let us know if you have any questions.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-07-2008
    Posts
    5

    Re: Complex Count

    Thanks JeteMc, your solution will certainly give me what I need. I will write into the worksheets and see how it goes.

    Thanks Again
    Andrew

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

    Re: Complex Count

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools link above your first post. I hope that you have a blessed day.

+ 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. [SOLVED] Complex Count Function
    By blens1 in forum Excel General
    Replies: 1
    Last Post: 06-06-2015, 08:52 PM
  2. Complex count if ?!
    By _Lewis in forum Excel General
    Replies: 4
    Last Post: 06-14-2011, 08:17 AM
  3. Formula Complex with IF and Count
    By Sultix in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-29-2008, 07:39 PM
  4. Function for complex count
    By reloader in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-20-2008, 06:13 AM
  5. complex count
    By FSmitty in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-03-2006, 06:25 PM
  6. Count using complex criteria
    By Rob in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-04-2005, 10:06 AM
  7. [SOLVED] complex count question
    By JBoulton in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-29-2005, 02:06 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