+ Reply to Thread
Results 1 to 8 of 8

Add Cells Whose Date Fall Between A Specific Range

  1. #1
    Forum Contributor
    Join Date
    12-22-2015
    Location
    San Antonio, Texas
    MS-Off Ver
    2016
    Posts
    116

    Add Cells Whose Date Fall Between A Specific Range

    I tried =SUMIFS and tried to input date ranges with >= & <= to no avail.
    Column A is formatted to display dates; column B displays numbers for the respective date. There are dates added daily.
    I need a formula to do the following: Updates automatically when new dates are entered. It would be for the month.
    For instance, there are thirty-one days in the month of January. Ergo, the formula would return a value in a cell for the thirty-one days of January.
    I tried the following, but it doesn't work:
    =SUMIF(A:A,">=DATE(2016,1,1)"&"<=DATE(2016,1,31)",B:B)
    where Column A displays dates and Column B displays values, but I always receive a value of 0.

    I would apply this separately for each month. I would just change the date value in the formula to match the month needed.
    Please help!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Add Cells Whose Date Fall Between A Specific Range

    Try this:
    To SUMIFS between dates, use the following:

    =SUMIFS(B:B,A:A,">="&DATE(2012,1,1),A:A,"<"&DATE(2012,6,1))

    Change up dates as appropriat
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Add Cells Whose Date Fall Between A Specific Range

    STBTC,

    Attached has Dates in Col A and Data in COl B

    Rather than changing formulae manually every time you want to check something. D2 - D13 are formatted as monthly dates ("Jan-16", etc)

    Following formula in E2 (copied down to E13) gives you monthly totals automatically:

    =SUMIFS(B:B,A:A,">="&D2,A:A,"<"&EDATE(D2,1))

    (Add up the totals in Col B where the date in Col A is between the first and last days of the Month in Col D)

    Because it used the entire columns, it will pick up automatically any new dates you enter - even if they are out of sequence.

    Ochimus
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    12-22-2015
    Location
    San Antonio, Texas
    MS-Off Ver
    2016
    Posts
    116

    Re: Add Cells Whose Date Fall Between A Specific Range

    I have a file that has dates in Sheet 1, Column E. Dates will be added throughout the year as it progresses. I need a formula that will add the corresponding column G for a specific date range--January, February, et cetera--and return a value in Sheet 2, Column B next to the corresponding month. Could someone help? I tried both alansidman and Ochimus' formulae, but to no avail. I know that those are the formulae which I should use, but I'm skipping a step, I think. I surmise that I am doing something incorrect. For example, I return a value of zero (0) for the month of January when the value returned should be forty-two (42).
    Attached Files Attached Files

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Add Cells Whose Date Fall Between A Specific Range

    Try this formula
    ={SUMPRODUCT(IF(MONTH(E2:E105)=1,G2:G105))} and enter it by holding down the Control + Shift + Enter keys to have the curly brackets added.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Add Cells Whose Date Fall Between A Specific Range

    Normally entered:

    =SUMPRODUCT(--(MONTH(E2:E105)=1),G2:G105)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Add Cells Whose Date Fall Between A Specific Range

    STBTC

    You could not get my solution to work on your file because the months in Col A of your Sheet 2 are not dates, but text.

    If you look at the attached, as soon as I changed the cells to dates everything works perfectly.

    BUT omitting the year from the description will give you problems going forward.

    Cell A2 says "January", (actual "date" 01/01/16). If you add A14 as also being "January" (actual "date" 01/01/17), the wording in Col A "as is" will not tell you which year is being reported?

    Which is why I structured the original as "Jan-16", Feb-16", etc.

    Ochimus
    Attached Files Attached Files

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Add Cells Whose Date Fall Between A Specific Range

    Another way in B1 and filled down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    or

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 03-24-2016 at 07:35 PM.
    Dave

+ 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. Does a task start or finish date fall within 3 month range of a specific date
    By jamesmcgallan in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-19-2015, 07:46 AM
  2. Need Macro that Highlights Values which Fall In Specific Range
    By Esuric in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2014, 03:27 AM
  3. [SOLVED] Counting cells that fall in a date range AND meet a Yes/No condition
    By pentatonic145 in forum Excel General
    Replies: 2
    Last Post: 05-01-2012, 04:26 PM
  4. Auto fill cells with a calculation if they fall in a given date range
    By timmy1254 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-09-2011, 08:31 PM
  5. Replies: 4
    Last Post: 03-18-2011, 07:02 AM
  6. Formula for determining if two date columns fall within specific date range
    By Igottabeme in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-20-2006, 09:55 PM
  7. Replies: 1
    Last Post: 04-20-2006, 05:10 PM

Tags for this Thread

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