+ Reply to Thread
Results 1 to 4 of 4

Selecting Between Two Date Ranges (based on days in month)

  1. #1
    Registered User
    Join Date
    04-01-2014
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    13

    Selecting Between Two Date Ranges (based on days in month)

    I have a list of data that displays data by day, I want to select only the data for the for the current month and then the same day time frame for previous months in the data set.

    E.g.

    Today's date 08/07
    Full days into month 7

    Formula to sum data in columns B that only looks at dates 01/07-07/7
    I will the adjust that formula for a January date that only pulls data for 01/01-01/07
    Then repeat for Feb-June

    I'm sure there was an easier way to explain this, hope it makes sense.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Selecting Between Two Date Ranges (based on days in month)

    Assuming your dates are in column A, try this (e.g. in C1):

    =SUMIFS(B:B,A:A,">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1),A:A,"<"&TODAY())

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    04-01-2014
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Selecting Between Two Date Ranges (based on days in month)

    Thanks for the reply but that doesn't seem to work as I need it to.

    Example.
    My data is in a table in Sheet 2
    My formula will be in Sheet 1 and will only extract data for the number days into the current month for each month

    So, 7 days into July.
    July is cell G1 and the formula in G2 will only return the 1st 7 days of data for July from the table in Sheet 2
    June is cell F1 and the formula in F2 will only return the the 1st 7 days of data for June from the table in sheet 2
    Same for Jan-May

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Selecting Between Two Date Ranges (based on days in month)

    I'm just going out now, but I'll pick this up later. In the meantime, why don't you attach a workbook which shows how your data is laid out - the FAQ describes how to attach a file to one of your posts.

    Hope this helps.

    Pete

+ 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. Replies: 8
    Last Post: 07-02-2014, 01:39 PM
  2. [SOLVED] Determine work days in current month or next month based on day of the month
    By sbrnard in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-29-2014, 05:14 PM
  3. Date Formula for days of the month, new dates starting on the 2nd of the month.
    By Kenn Jerger in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2013, 01:31 AM
  4. Replies: 12
    Last Post: 02-08-2013, 02:26 PM
  5. [SOLVED] Days off formula based on last date of the month
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-02-2012, 07:12 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