+ Reply to Thread
Results 1 to 7 of 7

Finding the total amount within a date range.

  1. #1
    Registered User
    Join Date
    05-16-2015
    Location
    England
    MS-Off Ver
    2007
    Posts
    2

    Finding the total amount within a date range.

    So I've got an amount, frequency, start date and end date in columns A, B, C & D respectively. What I've been looking to do (and struggling with immensely) is to find the total amount within a certain month. This is an example of the format Example.xlsx and I'd appreciate any help I can get, thanks.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Finding the total amount within a date range.

    total amount within a certain month
    You need to be more specific about this because the dates for a given Amount can span more than one month, and how you take into account the various frequencies. For example, what is the total in February for this?

    Please Login or Register  to view this content.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-16-2015
    Location
    England
    MS-Off Ver
    2007
    Posts
    2

    Re: Finding the total amount within a date range.

    Well that's what I need to work out and is why I'm having so much trouble. So if the end date for a row creeps into February for example, I need to be able to work out by how any days and then the amount from that. Is this just beyond the range of excel?

  4. #4
    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,936

    Re: Finding the total amount within a date range.

    Hi, welcome to the forum

    Is this just beyond the range of excel?
    highly unlikely.

    Given your sample data, what would the answer be, and how did you arrive at that?
    Last edited by FDibbins; 05-16-2015 at 10:01 PM.
    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

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Finding the total amount within a date range.

    We can get Excel to do whatever you want, but you have to know what you want first.

    If you have an amount of 5 and frequency of "weekly" when do those 5 things happen relative to the week? In the example I gave, there is only one day in February included. Do any of those 5 things happen on that day? If so, how can you tell? If they happen continuously, like $5 paid per week, then the amount for that first day would be prorated at $5/7 = $0.71. But if it's discrete values like phone calls, you can't have 0.71 of a phone call.

    To complicate matters the period you gave is 4 weeks plus 1 day for a weekly frequency.

    It might help if you told us more about your problem, like what "amount" means and how "frequency" is used.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Finding the total amount within a date range.

    The attached uses helper columns. I assumed that the values in column A are rates per frequency unit; i.e., 2 per week, 5 per month, etc. Maybe it will give you some ideas for a start. Please click K 1 to select the month.
    Attached Files Attached Files
    Ben Van Johnson

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Finding the total amount within a date range.

    Here's my interpretation...

    If any dates in the Start/End range span the From/To date range then sum the corresponding values in column A.

    Data Range
    A
    B
    C
    1
    Value
    Start
    End
    2
    108
    1/1/2015
    1/31/2015
    3
    58
    1/15/2015
    1/31/2015
    4
    176
    1/1/2015
    1/28/2015
    5
    13
    10/16/2014
    3/16/2016
    6
    192
    2/28/2015
    3/28/2015
    7
    10
    12/20/2015
    1/1/2016
    8
    9
    Total
    From
    To
    10
    355
    1/1/2015
    1/31/2015


    So, in this example rows 2, 3, 4 and 5 are being summed.

    This (crazy complicated) array formula** entered in A10:

    =SUM(IF(IF(IF(C2:C7<=C10,C2:C7,C10)-IF(B2:B7>=B10,B2:B7,B10)+1<0,0,IF(C2:C7<=C10,C2:C7,C10)-IF(B2:B7>=B10,B2:B7,B10)+1),A2:A7))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    I'm thinking that DLL (the undisputed master of date formulas) can come up with something a lot less convoluted.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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: 2
    Last Post: 08-11-2014, 09:56 PM
  2. Finding total range of multiple inputs?
    By justinb1022 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 04-22-2013, 09:18 AM
  3. finding last and creating average amount income to date
    By Jerry Kinder in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-04-2006, 01:10 PM
  4. [SOLVED] finding a range of dates to total
    By Danbmarine in forum Excel General
    Replies: 4
    Last Post: 01-27-2006, 05:35 PM
  5. Calculate the total amount by date
    By 肥權 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2005, 12:45 PM

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