+ Reply to Thread
Results 1 to 10 of 10

Select data between dates and display them by month

  1. #1
    Registered User
    Join Date
    08-03-2017
    Location
    Australia, Brisbane QLD
    MS-Off Ver
    2016
    Posts
    8

    Select data between dates and display them by month

    I would like to select data between dates and display them by month. For example in E6 should contain a 1 as per the List in rows A and B. I used a SUMPRODUCT to get the total for a month for a whole list but not for a reporting period. Is this possible? Thank you.
    Attached Files Attached Files
    Last edited by Jamie_QHSE; 10-16-2017 at 01:59 AM.

  2. #2
    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,644

    Re: Select data between dates and display them by month

    I do not see your SUMPRODUCT formula.
    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.

  3. #3
    Registered User
    Join Date
    08-03-2017
    Location
    Australia, Brisbane QLD
    MS-Off Ver
    2016
    Posts
    8

    Re: Select data between dates and display them by month

    I have re uploaded the correct version - Please refer Column H

  4. #4
    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,644

    Re: Select data between dates and display them by month

    Step one (for learning purposes) in E6 copied across and down:

    =SUMPRODUCT(--(MONTH($A$2:$A$17)=COLUMNS($E5:E5))*($B$2:$B$17=$D6))

    Now adapt it to this in E6 copied across and down:

    =IF(AND(MONTH($E$2)>=COLUMNS($E5:E5),MONTH($E$3)<=COLUMNS($E5:E5)),SUMPRODUCT(--(MONTH($A$2:$A$17)=COLUMNS($E5:E5))*($B$2:$B$17=$D6)),"")

  5. #5
    Registered User
    Join Date
    08-03-2017
    Location
    Australia, Brisbane QLD
    MS-Off Ver
    2016
    Posts
    8

    Re: Select data between dates and display them by month

    Thank you, is there a way to make this work to populate the data across multiple months if the reporting period is 17-Jan-17 and 1/09/2017.

  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,644

    Re: Select data between dates and display them by month

    That's what it does. Did you try it?

    EDIT: Oops! My mistake - try it the other way around:

    =IF(AND(COLUMNS($E5:E5)>=MONTH($E$2),COLUMNS($E5:E5)<=MONTH($E$3)),SUMPRODUCT(--(MONTH($A$2:$A$17)=COLUMNS($E5:E5))*($B$2:$B$17=$D6)),"")
    Last edited by AliGW; 10-16-2017 at 04:13 AM.

  7. #7
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Select data between dates and display them by month

    Perhaps
    =SUMPRODUCT(($A$2:$A$17>=$E$2)*($A$2:$A$17<=$E$3)*($B$2:$B$17=$D6)*(TEXT($A$2:$A$17,"mmm")=E$5)) in in cell E6

    Although you should change january to jan, to be consistent

  8. #8
    Registered User
    Join Date
    08-03-2017
    Location
    Australia, Brisbane QLD
    MS-Off Ver
    2016
    Posts
    8

    Re: Select data between dates and display them by month

    I have uploaded a copy with your formula for your reference. As you detailed i copied the formula across and down.
    Attached Files Attached Files

  9. #9
    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,644

    Re: Select data between dates and display them by month

    You used the wrong version - see post #6.

    Excel 2016 (Windows) 32 bit
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    1
    REPORTING DETAILS
    2
    Enter period Date From
    01/01/2017
    3
    Enter period Date To
    01/09/2017
    4
    TRENDING DATA ALALYSIS REPORTING PERIOD
    5
    INCIDENT TYPE
    January
    Feb
    Mar
    Apr
    May
    Jun
    Jul
    Aug
    Sep
    Oct
    Nov
    Dec
    Total
    6
    Personal Injury
    1
    0
    0
    2
    1
    0
    0
    1
    0
    7
    Plant/ Equipment
    1
    0
    0
    1
    1
    0
    0
    0
    0
    8
    Electrical
    0
    0
    0
    0
    0
    0
    0
    0
    0
    9
    Asset Damage
    0
    1
    2
    0
    0
    1
    0
    1
    2
    10
    Environmental
    1
    0
    0
    0
    0
    0
    0
    0
    0
    11
    HR
    0
    0
    0
    0
    0
    0
    0
    0
    0
    12
    Project Management
    0
    0
    0
    0
    0
    0
    0
    0
    0
    13
    Emergency Scenario
    0
    0
    0
    0
    0
    0
    0
    0
    0
    14
    Monthly Totals
    3
    1
    2
    3
    2
    1
    0
    2
    2
    0
    0
    0
    0
    Sheet: Sheet1

    Excel 2016 (Windows) 32 bit
    E
    6
    =IF(AND(COLUMNS($E5:E5)>=MONTH($E$2),COLUMNS($E5:E5)<=MONTH($E$3)),SUMPRODUCT(--(MONTH($A$2:$A$17)=COLUMNS($E5:E5))*($B$2:$B$17=$D6)),"")
    Sheet: Sheet1
    Last edited by AliGW; 10-17-2017 at 02:42 AM.

  10. #10
    Registered User
    Join Date
    08-03-2017
    Location
    Australia, Brisbane QLD
    MS-Off Ver
    2016
    Posts
    8

    Re: Select data between dates and display them by month

    Thank you for you help, the formula worked perfectly.

+ 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. Data Validation list - display only dates of this month from 1 to today
    By laansesu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-13-2016, 12:22 PM
  2. Select columns, compare dates and display column title with oldest date
    By rluesc in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 01-03-2016, 03:47 PM
  3. [SOLVED] Calculation of days per month for dates beginning in one month and ending in another month
    By Fahrettin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-07-2015, 04:52 PM
  4. [SOLVED] Display the name of month from a range of dates
    By hermithead in forum Excel General
    Replies: 3
    Last Post: 01-19-2015, 07:33 AM
  5. Display all Thursday dates in month
    By badincite in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-25-2014, 08:22 PM
  6. [SOLVED] if i select multiple dates, i would like all activity from another tab to display
    By Netzqua in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-07-2013, 02:19 PM
  7. Display all dates for given month
    By Tha-G in forum Excel General
    Replies: 3
    Last Post: 10-29-2010, 12:01 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