+ Reply to Thread
Results 1 to 9 of 9

Summarize data into occurrences per month

  1. #1
    Registered User
    Join Date
    05-12-2015
    Location
    Miami, FL
    MS-Off Ver
    365
    Posts
    49

    Summarize data into occurrences per month

    Hello Excel Forum, I need help!

    The data below shows how many times each student (i.e. Steve, Martha and James) were either present or tardy for class on various dates. I would like to summarize the data into how many Present occurrences there are per month:

    June: 4
    July: 3
    August: 5
    September: 6

    'Date' cell reference: A1

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Summarize data into occurrences per month

    here is one way, assuming you put 6/1/2018 in G1 and 7/1/2018 in H1 etc going toward the right then putting this in G2 and dragging right...

    =COUNTIFS($A$2:$A$11,">="&G$1,$A$2:$A$11,"<"&H$1,$B$2:$B$11,"present")+COUNTIFS($A$2:$A$11,">="&G$1,$A$2:$A$11,"<"&H$1,$C$2:$C$11,"present")+COUNTIFS($A$2:$A$11,">="&G$1,$A$2:$A$11,"<"&H$1,$D$2:$D$11,"present")

    this also assumes your data is in columns A, B, C and D beginning in A1 as shown above.
    A sumproduct would also likely work but I didn't work that one out yet.
    EDITED, something copied wrong so I corrected the formula.
    Last edited by Sam Capricci; 05-30-2018 at 03:20 PM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,925

    Re: Summarize data into occurrences per month

    Although it might take a bit more work on data entry, if you enter the data in in normalized format as shown in the attached spreadsheet, you can use it in a pivot table and get it in almost any format imaginable.

    One of the advantages of pivot tables is that they adjust automatically to new data such as a new student. As the data are organized now, you would have to write a special formula for each student or month depending on how you want to display the data. Look up COUNTIF.

    I suggest you try out some pivot table tutorials on line. They explain it better than I can.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Summarize data into occurrences per month

    this sumproduct would work too assuming the same locations and is a little simpler...
    =SUMPRODUCT(($B$2:$D$11="present")*($A$2:$A$11>=G1)*($A$2:$A$11<H1))
    again, G1 is 6/1/2018, H1 is 7/1/2018, I1 would be 8/1/2018 etc

  5. #5
    Registered User
    Join Date
    05-12-2015
    Location
    Miami, FL
    MS-Off Ver
    365
    Posts
    49

    Re: Summarize data into occurrences per month

    Hello Sambo kid, thank you for the reply! I will try the COUNTIFS.

    I have tried SUMPRODUCT but I'm stuck.

    =SUMPRODUCT(--(MONTH($A$2:$A$11)=6),--($B$2:$B$11="Present")) works for column B (Steve), but I need the formula to account from columns B thru D.

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Summarize data into occurrences per month

    check my post #4, it worked for data in B through D by month.

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Summarize data into occurrences per month

    if you want to use "month" in the formula this also works and you don't have to point it at G1 or 6/1/2018, the "month" will be equal to the column value which for F1 is 6

    =SUMPRODUCT(($B$2:$D$11="present")*(MONTH($A$2:$A$11)> =COLUMN(F$1))*(MONTH($A$2:$A$11)< COLUMN(G$1)))
    dragged right it indexes to column G1 and H1 which would represent months 7 and 8

  8. #8
    Registered User
    Join Date
    05-12-2015
    Location
    Miami, FL
    MS-Off Ver
    365
    Posts
    49

    Re: Summarize data into occurrences per month

    Hi Sambo kid, you're a genius! Thanks!

    With your help I was able to tweak the formula to this:

    =SUMPRODUCT(($B$2:$D$11="Present")*(MONTH($A$2:$A$11)=MONTH(DATEVALUE(B23&" 1"))))

    This way I can use the month name. Thanks again.

  9. #9
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Summarize data into occurrences per month

    You're welcome. And if you are so inclined a bump to the rep is always welcome.

+ 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. Summarize Data by Month by Person
    By mason736 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-27-2016, 04:35 PM
  2. Summarize total amount with different month
    By umininnel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-27-2015, 08:28 PM
  3. Replies: 6
    Last Post: 03-03-2013, 01:41 AM
  4. Counting occurrences within each month
    By Fatosi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-14-2012, 04:26 PM
  5. Best way to summarize into month
    By bluerog in forum Excel General
    Replies: 4
    Last Post: 02-22-2011, 05:21 PM
  6. Summarize numbers by month
    By hereami in forum Excel General
    Replies: 3
    Last Post: 05-17-2010, 02:21 AM
  7. add occurrences by month
    By trsmith in forum Excel General
    Replies: 2
    Last Post: 06-17-2009, 03:28 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