+ Reply to Thread
Results 1 to 8 of 8

Dynamic calculation based on individual start and end dates

  1. #1
    Forum Contributor
    Join Date
    06-24-2009
    Location
    Germany, MG
    MS-Off Ver
    Excel 2010
    Posts
    131

    Dynamic calculation based on individual start and end dates

    Hi folks,

    I want to calculate budgets for an individual period based on given yearly budgets. It's probably best if you have a look at the example sheet.

    In C3:C4, users can specify start and end dates for the period they want to consider. Cells B5:C8 contain the externally given budgets.
    In cell C10 I would like to have an automated calculation that gives me a budget for the specified period. This budget should contain a linearly derived part of the yearly budget based.
    In the given example one-half of 2015 and one quarter of 2017 as well as 2016 are included in the desired period. Accordingly the respective budget should be 325.

    Does anyone have an easy solution for a formula for cell C10?

    Thanks a lot and have a great new year.
    Attached Files Attached Files
    Last edited by Cunner; 01-06-2016 at 04:07 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Dynamic calculation based on individual start and end dates

    If the range will always span the 3 periods in the table, then try this:-

    =DAYS360(C2,"31/12/"&YEAR(C2))*C6/360+C7+DAYS360("1/1/"&YEAR(C3),C3)*C8/360

  3. #3
    Forum Contributor
    Join Date
    06-24-2009
    Location
    Germany, MG
    MS-Off Ver
    Excel 2010
    Posts
    131

    Re: Dynamic calculation based on individual start and end dates

    Unfortunately, the date range can be completely arbitrarily set and span any number of years.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Dynamic calculation based on individual start and end dates

    To be absolutely certain, the table of budget values can be of any length spanning any number of years. Is that correct?
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Dynamic calculation based on individual start and end dates

    Maybe this will work for you. I created a table in G2:H37 of years with arbitrary amounts for the budget of each year going to the year 2050.
    First year calculation which calculates days of the year instead of months that can have a varying number of days.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Last year calculation:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Calculation of years between start and end
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Total amount from Start to End
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The workbook enclosed has the table created as well as the steps broken down and the final calculation. If you want to keep the steps you can simplify the total calculation by simply summing the steps that I have included.

    The amount calculated works out to odd cents not equalling your round total but it is less than $1.00 difference.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Dynamic calculation based on individual start and end dates

    Now THAT is why the forum has guru's :D

  7. #7
    Forum Contributor
    Join Date
    06-24-2009
    Location
    Germany, MG
    MS-Off Ver
    Excel 2010
    Posts
    131

    Re: Dynamic calculation based on individual start and end dates

    Wow, thanks a lot. It works perfectly!
    Just to understand it better: why do you put a "--" in front of the YEAR in the SUMPRODUCT formula?

    EDIT: I changed the "365" in the denominator to a function that actually counts the days in a given year to accomodate for "Leap years" (is that how you say it?).
    Last edited by Cunner; 01-06-2016 at 04:25 AM.

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Dynamic calculation based on individual start and end dates

    Leap years is correct.
    The -- in the SUMPRODUCT isn't necessary in this case. It forces the value to be numeric. It was an error on my part.

+ 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. Traffic light individual cell based on training dates due
    By jjscaramanga in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2015, 06:28 AM
  2. Replies: 1
    Last Post: 03-12-2015, 04:40 PM
  3. [SOLVED] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-20-2014, 07:42 PM
  4. [SOLVED] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-18-2014, 07:55 AM
  5. Depreciation Straight line Calculation based on start and end date
    By anjoseph9626 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-03-2013, 04:44 PM
  6. Turn Start/End Dates into individual days
    By ker9 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-17-2011, 01:17 PM
  7. Dynamic charts with different start dates
    By gadu^ in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-25-2007, 10:23 AM

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