+ Reply to Thread
Results 1 to 4 of 4

Formula summing data between two dates

  1. #1
    Registered User
    Join Date
    10-04-2007
    Posts
    3

    Formula summing data between two dates

    I'm looking for a formula that will sum data in a range based on a certain date range.

    For example. I have a project that is starting on 1/1/08 and lasting 24 months so the end date would be 12/31/09. I need to add all the costs in 2008 and then in a seperate cell add all the costs in 2009. I need the formula to be able to adjust with the beginning date. Sof if the starting date is 6/1/08 and ends 6/30/10 I need the formula to be able to handle that.

    Any help would be greatly appreciated!
    Last edited by barefoot152; 10-04-2007 at 10:08 AM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Sumproduct should work

    http://www.xldynamic.com/source/xld.SUMPRODUCT.html

    Lots of examples on forum. Just search dates and sumproduct.

    If you want someone to provide a formula post a sample file

    VBA Nobo
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    10-04-2007
    Posts
    3

    Example

    What i'm looking for is attached in the excel file. What would be the sum for 2008 based on the start date?
    Attached Files Attached Files
    Last edited by barefoot152; 10-04-2007 at 10:37 AM.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Does this help

    =SUMPRODUCT(--(YEAR($A$5:$A$40)=YEAR($B$1)+(ROW(A1)-1))*($B$5:$B$40))
    VBA Noob

+ 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