+ Reply to Thread
Results 1 to 8 of 8

Sum of past 30 days of data

  1. #1
    Registered User
    Join Date
    09-09-2011
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Sum of past 30 days of data

    Howdy,

    First time poster here slowly going insane at my inability to do what I initially thought would be simple, but apparently is not.

    Column A has a list of dates
    Column B has a list of values

    I want one single cell to show me what the total of the past 30 days worth of values are based on today's date, allowing me to enter a corresponding value every day and for the cell to automatically calculate the total value for the past 30 days.

    I feel like I've tried everything, but nothing wants to work. Any ideas?
    Last edited by drummerdickens; 09-22-2011 at 06:21 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Sum of past 30 days of data

    Hi drummerdickens and welcome to the forum.

    I believe this is a job for the SumIf function.
    http://office.microsoft.com/en-us/ex...005209292.aspx

    See the attached with an example.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    09-09-2011
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Sum of past 30 days of data

    I love you. I really do.

    Turns out I had managed to do this, except my dummy data I was using to test it stretched PAST todays date, and that formula starts adding up not only the past 30 days of data but anything after todays date too!

    It wasn't until I saw that you did the same thing that realised it must've been a mistake my end with the data. I really appreciate it, good stuff bro.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Sum of past 30 days of data

    Turn all that love into a "Pay it forward" event. Help others and that's enough for me.

  5. #5
    Registered User
    Join Date
    09-09-2011
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Sum of past 30 days of data

    OK. I appreciate this is somewhat of a bump but I thought it would make more sense to ask this question here in case anyone ever has the same problem and goes searching for it.

    I have a new problem with this formula; the department I have given this to have decided they want to input future dates and their values. This is where the formula falls down; the formula will add all values for the past 30 days AND any future dates.

    They require a formula that ignores both the values 31 days and further and anything values in the future (values past today's date).

    I have literally no idea how to go about this. Any ideas would amaze me, and be appreciated!

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Sum of past 30 days of data

    Maybe =SUMPRODUCT((A2:A344>TODAY()-30)*(A2:A344<TODAY()+1)*B2:B344)

    Adapt the range to suit your needs

  7. #7
    Registered User
    Join Date
    09-09-2011
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Sum of past 30 days of data

    You did it. You bloody well did it.

    Tell me chaps, how do you get so good at Excel? Did you take courses, or are there any books or websites I can peruse to really up my standard? Or was it out of necessity (much like what I'm facing) where you are given a problem and you just have had to find a way to do it browsing the internet?

    Fantastic stuff lads.

  8. #8
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Sum of past 30 days of data

    XL, as our forum, has rules that can be best learned by practice. To start :


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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