+ Reply to Thread
Results 1 to 8 of 8

sumif between two date ranges

  1. #1
    Registered User
    Join Date
    01-08-2014
    Location
    indio, california
    MS-Off Ver
    Excel 2010
    Posts
    3

    sumif between two date ranges

    what is the formula to use if I'd like to add daily value between specific dates
    for example
    column A:
    customer ID 1 (A1)
    customer ID 2 (A2)

    column B:
    customer ID 1 start date (B1)
    customer ID 2 start date(B2)

    column C:
    customer ID 1 end date (C1)
    customer ID 2 end date (C2)

    column D:
    customer ID 1 amount for day1 (D1)
    customer ID 2 amount for day1 (D2)

    column E:
    customer ID 1 amount for day2
    customer ID 2 amount for day2

    continue horizontally until day 365

    How do I sum each customer daily value based on start and end date?
    Thank you for any help
    Last edited by paray001; 01-08-2014 at 05:27 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,688

    Re: sumif between two date ranges

    A bit strange data layout.
    Basically you hava data for each custID in a separate row, but want to sum only part of it, based on dates in column B and C.
    So try such a formula, provided dates in column B and C are indeed excel dates (not texts looking similar to dates) and day1 is Jan 1 2014, day2 JAn2 and so on :

    =SUM(INDIRECT(ADDRESS(ROW(1:1),C1-DATE(2014,1,0)+3)&":"&ADDRESS(ROW(1:1),B1-DATE(2014,1,0)+3)))

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969

    Re: sumif between two date ranges

    Hi and welcome to the forum

    I think you need to re-think your layout here. With a better structure, you could probably use the COUNTIFS() and/or the SUMIFS() functions. Although you could probably use the SUMIFS() with your existing layout, a more structured table will be easier to manage and run calcs on.

    I suggest you aqttach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    01-08-2014
    Location
    indio, california
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: sumif between two date ranges

    here is the sample... Thank you Kaper and FDibbins for your help with this
    Attached Files Attached Files

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,688

    Re: sumif between two date ranges

    Well, the layout is slightly different then described in the first post, so the formula has to be slightly modified to adopt the changes. But generally it is the same. (as you have in F1 first day, it is no longer needed to use DATE function). For C2:
    Please Login or Register  to view this content.
    And copy down.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969

    Re: sumif between two date ranges

    Try this, copied down...
    =SUMIFS(F2:Y2,$F$1:$Y$1,">="&D2,$F$1:$Y$1,"<="&E2)

  7. #7
    Registered User
    Join Date
    01-08-2014
    Location
    indio, california
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: sumif between two date ranges

    Thank you both very much!!!!

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969

    Re: sumif between two date ranges

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

+ 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. SUMIF by Date - SUMIF by Date = #VALUE when linked worksheet not open
    By alexhartley in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-14-2013, 03:56 AM
  2. using sumif on different ranges depending on a date column
    By dwilkinson12 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-24-2013, 12:17 PM
  3. Replies: 7
    Last Post: 10-08-2012, 01:53 AM
  4. Excel 2007 : sumif date ranges
    By df180 in forum Excel General
    Replies: 2
    Last Post: 11-16-2011, 08:55 PM
  5. sumif and date ranges
    By gregvb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-03-2007, 02:43 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