+ Reply to Thread
Results 1 to 4 of 4

Date based accrual formula adding time

  1. #1
    Registered User
    Join Date
    09-29-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Date based accrual formula adding time

    Hoping someone can figure out what it going on with this formula! I'm trying to create a formula that will automatically calculate an employees vacation balance based on three variable:
    1. The employees start date relative to the date the entry is made
    2. The accrual of .8333 days per month (10 days off per year divided by 12 months)
    3. The subtraction of any PTO that is accounted for in column E of the spreadsheet

    The formula in column G almost works but it is adding time at slightly increasing increments as the formula is applied to future entries. To be more specific: in cell G6 it adds 1, in cell G7 approximately 1.2 and up and up...

    Formula currently looks like this:

    =IF((YEAR(D6)-YEAR(D5))*12+MONTH(D6)-MONTH(D5)>0,(G5+((YEAR(D6)-YEAR(D5))*12+MONTH(D6)-MONTH(D5)*10/12))-E6,(G5-E6))

    Spreadsheet is attached but to map the fields:

    D6 = Date of entry
    D5 = Date of previous entry
    G5 = Previous balance (in days)
    E6 = Number of days to be subtracted from employee vacation balance


    Totally stumped and any help is appreciated!
    Attached Files Attached Files
    Last edited by TheJessle; 09-29-2011 at 02:43 PM. Reason: Problem Solved

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Date based accrual formula adding time

    How about

    =G$5+N(DATEDIF($B$2,D6,"M")*10/12)-SUM($E$5:E6)

    in G6 and down

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Date based accrual formula adding time

    You might be able to simplify the formula using DATEDIF to get the difference in months -try this formula in G6 copied down

    =DATEDIF(D5-DAY(D5)+1,D6,"m")*10/12+G5-E6
    Audere est facere

  4. #4
    Registered User
    Join Date
    09-29-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Thumbs up Re: Date based accrual formula adding time

    PERFECT! Thank you both - that solved the problem wonderfully.

    I guess that's what happens when you get too complicated.

+ 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