+ Reply to Thread
Results 1 to 10 of 10

Sum a variable # of cells based on a date

  1. #1
    Registered User
    Join Date
    04-12-2021
    Location
    Guelph, Ontario, Canada
    MS-Off Ver
    2019
    Posts
    6

    Sum a variable # of cells based on a date

    I am trying to calculate the sum of values in column "C", based on the previous rows that are within a year of the date that is located in column "A" column.

    I thought SUMIF would do it but I have not found the successful syntax to make this happen, or perhaps SUMIF does not have the functionality to do this.

    I do not want to have to write a VBA script to do this if possible.

    Any suggestions?

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,639

    Re: Sum a variable # of cells based on a date

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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
    04-12-2021
    Location
    Guelph, Ontario, Canada
    MS-Off Ver
    2019
    Posts
    6

    Re: Sum a variable # of cells based on a date

    first thank you for responding to my question.

    I am sorry, I am new to this site and do not understand your comments of what I should do.

    Are you suggesting to post the spreadsheet to use as a basis for discussion?

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,639

    Re: Sum a variable # of cells based on a date

    Yes - a sample workbook. Do you see the yellow box at the top of the page? That's where the instructions are.

  5. #5
    Registered User
    Join Date
    04-12-2021
    Location
    Guelph, Ontario, Canada
    MS-Off Ver
    2019
    Posts
    6

    Re: Sum a variable # of cells based on a date

    okay.. lets try the attached spreadsheet .. please note that column "D" is where the
    formula would reside, and the results should be what I manually calculated.

    I have uploaded a file called "SampleVariableSum.xlsx" ... I hope it got uploaded okay.

    Again, thanks for the help
    Attached Files Attached Files

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,639

    Re: Sum a variable # of cells based on a date

    Here you go - in E5 copied down:

    =SUMIFS($C$5:$C$19,$B$5:$B$19,">="&B5,$B$5:$B$19,"<="&EDATE(B5,3))

  7. #7
    Registered User
    Join Date
    04-12-2021
    Location
    Guelph, Ontario, Canada
    MS-Off Ver
    2019
    Posts
    6

    Re: Sum a variable # of cells based on a date

    if this works, I owe you big time ..... thanks

  8. #8
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,639

    Re: Sum a variable # of cells based on a date

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  9. #9
    Registered User
    Join Date
    04-12-2021
    Location
    Guelph, Ontario, Canada
    MS-Off Ver
    2019
    Posts
    6

    Smile Re: Sum a variable # of cells based on a date

    outstanding .. it works .. well done .. and where have you been all my life ....

    I hope that I clicked the right "star" as this truly solved a big issue for me.

    Thank you

  10. #10
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,639

    Re: Sum a variable # of cells based on a date

    It was a pleasure.

+ 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: 6
    Last Post: 09-30-2020, 09:42 PM
  2. [SOLVED] Looking for a MAX date based on variable row number
    By kenhunter in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 06-12-2020, 07:07 AM
  3. Replies: 12
    Last Post: 12-30-2017, 10:35 AM
  4. [SOLVED] SUM rows based on a variable date
    By Mangorni in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 12-05-2017, 09:02 AM
  5. auto-populate a date based on date began and other variable
    By rcm4486 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-17-2017, 10:05 AM
  6. auto-populate a date based on date began and other variable
    By rcm4486 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2017, 07:58 AM
  7. Sum cells based on a row variable and seperate column variable
    By CheeseHeadTransplant in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-23-2005, 02:05 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