+ Reply to Thread
Results 1 to 10 of 10

Add between dates and

  1. #1
    Registered User
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    5

    Add between dates and

    I have a problem, I created a formula to sum up items that are between dates: =(SUMIF(A:A,"<="&DATE(year(F1),month(F1),day(F1)),J:J)-SUMIF(A:A,"<"&DATE(year(C1),month(C1),day(C1)),J:J))
    but say I have a list like:

    7/1/12 bk 5
    7/1/12 rk 3
    7/2/12 bk 2
    7/3/12 se 9

    That formula will will to sum is everything is the same in a particular problem but if i have a list like that, what can I add onto the formula that will only sum the bk's that is between certain dates?

  2. #2
    Registered User
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Add between dates and

    I really need some help with this, any ideas that might work.

  3. #3
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Add between dates and

    Hello
    If for example your data was in the range A2:C5. Your From date in F2, your To date in G2 and finally your Code in H2, then the following formula should work:

    =SUMPRODUCT((A2:A5>=F2)*(A2:A5<=G2)*(B2:B5=H2)*C2:C5)

    Hope this helps.
    DBY

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,457

    Re: Add between dates and

    Try
    Please Login or Register  to view this content.
    Adapt ranges to your needs

  5. #5
    Registered User
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Add between dates and

    Here is a open doc link that I have the example: https://docs.google.com/spreadsheet/...1hjdmFkeW1KcWc at the top there is bk, rk, io, se and dates above that, i want to be able to insert different dates, and then for each of the 4 items have them total column C for the dates at the top.

  6. #6
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Add between dates and

    Hello
    I've recreated your Google Docs example in Excel. Take a look at the attachment. I've used Pepe's version of SUMPRODUCT with the double negatives (--) as it's more efficient if you're using a large data set. Note my dates are in the UK format you may have to change them.

    DBY
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Add between dates and

    Thats great DBY, it works in excel, copy and pasting that into that google doc I get a parse error? You can edit that google doc if you like its open. google docs is all I use as I have a lot of people looking at reports. any idea why I am getting that error?

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,457

    Re: Add between dates and

    Ask the people at Google

  9. #9
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Add between dates and

    Hello
    I've changed the formula in your Google Docs spreadsheet, it now seems to work. It doesn't accept the (--) and you have to wrap it in 'ArrrayFormula'. Took me awhile to figure it out, a bit of Googling was required.

    DBY

  10. #10
    Registered User
    Join Date
    07-10-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Add between dates and

    Thank you, that has taken me 5 months for me to even try to figure out it, you just saved me 2 hours a day, thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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