+ Reply to Thread
Results 1 to 17 of 17

Cost apportionment / accrual period formula

  1. #1
    Registered User
    Join Date
    05-02-2024
    Location
    Vancouver
    MS-Off Ver
    Office 365
    Posts
    60

    Question Cost apportionment / accrual period formula

    Hello!

    I have a really simple one that I'm having trouble with!

    All I'm looking to do is apportion a total cost to a specified period.

    E.g. In the sheet there will be a row with the following data:
    Col A - Amount
    Col B - Period Start
    Col C - Period End

    E.g. I have a wage that I paid for $3269.23 that covered the 2 week period of 22-Mar-2025 to 04-Apr-2025 (period always starts on a Saturday and ends on a Friday).

    I want to apportion that cost correctly to the March period. In theory it should be total cost / 14 days, multiplied by the # days that are in March.

    You can see in the example sheet (Col D) a formula from the internet that I found but I don't think it's doing the correct calc. I have it laid out in the example sheet.

    I just want a clean and elegant formula that works without having to do the manual calc I show above!

    Surely there's an excel function that just does this for us at this point? What do all the accountants do?!

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2508 Win 11
    Posts
    24,959

    Re: Cost apportionment / accrual period formula

    I did it with a couple of helper columns instead of one formula.

    Excel 2016 (Windows) 64 bit
    F
    G
    H
    6
    EOM Adj Days in Currentt Month Current Period Wages
    7
    =IF(E7-14<B7,E7,"") =IF(F7="","",E7-B7) =IFERROR((A7/14)*G7,"")
    8
    =IF(E8-14<B8,E8,"")
    =IF(F8="","",E8-B8+1)
    =IFERROR((A8/14)*G8,"")
    9
    =IF(E9-14<B9,E9,"") =IF(F9="","",E9-B9+1) =IFERROR((A9/14)*G9,"")
    10
    =IF(E10-14<B10,E10,"")
    =IF(F10="","",E10-B10+1)
    =IFERROR((A10/14)*G10,"")
    11
    =IF(E11-14<B11,E11,"") =IF(F11="","",E11-B11+1) =IFERROR((A11/14)*G11,"")
    12
    =IF(E12-14<B12,E12,"")
    =IF(F12="","",E12-B12+1)
    =IFERROR((A12/14)*G12,"")
    13
    =IF(E13-14<B13,E13,"") =IF(F13="","",E13-B13+1) =IFERROR((A13/14)*G13,"")
    14
    =IF(E14-14<B14,E14,"")
    =IF(F14="","",E14-B14+1)
    =IFERROR((A14/14)*G14,"")
    15
    =IF(E15-14<B15,E15,"") =IF(F15="","",E15-B15+1) =IFERROR((A15/14)*G15,"")
    16
    =IF(E16-14<B16,E16,"")
    =IF(F16="","",E16-B16+1)
    =IFERROR((A16/14)*G16,"")
    17
    =IF(E17-14<B17,E17,"") =IF(F17="","",E17-B17+1) =IFERROR((A17/14)*G17,"")
    18
    =IF(E18-14<B18,E18,"")
    =IF(F18="","",E18-B18+1)
    =IFERROR((A18/14)*G18,"")
    19
    =IF(E19-14<B19,E19,"") =IF(F19="","",E19-B19+1) =IFERROR((A19/14)*G19,"")
    20
    =IF(E20-14<B20,E20,"")
    =IF(F20="","",E20-B20+1)
    =IFERROR((A20/14)*G20,"")
    21
    =IF(E21-14<B21,E21,"") =IF(F21="","",E21-B21+1) =IFERROR((A21/14)*G21,"")
    22
    =IF(E22-14<B22,E22,"")
    =IF(F22="","",E22-B22+1)
    =IFERROR((A22/14)*G22,"")
    23
    =IF(E23-14<B23,E23,"") =IF(F23="","",E23-B23+1) =IFERROR((A23/14)*G23,"")
    24
    =IF(E24-14<B24,E24,"")
    =IF(F24="","",E24-B24+1)
    =IFERROR((A24/14)*G24,"")
    25
    =IF(E25-14<B25,E25,"") =IF(F25="","",E25-B25+1) =IFERROR((A25/14)*G25,"")
    26
    =IF(E26-14<B26,E26,"")
    =IF(F26="","",E26-B26+1)
    =IFERROR((A26/14)*G26,"")
    27
    =IF(E27-14<B27,E27,"") =IF(F27="","",E27-B27+1) =IFERROR((A27/14)*G27,"")
    28
    =IF(E28-14<B28,E28,"")
    =IF(F28="","",E28-B28+1)
    =IFERROR((A28/14)*G28,"")
    29
    =IF(E29-14<B29,E29,"") =IF(F29="","",E29-B29)
    Sheet: Example
    Attached Files Attached Files
    Last edited by alansidman; 05-18-2025 at 01:44 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,678

    Re: Cost apportionment / accrual period formula

    The formula you're using is based on the data from end date - start date, with the difference being the gap between the two dates (only counting one of the start or end dates).
    However, since you’ve defined the working period as starting on Saturday and ending on Friday, the difference of 7 days means 6 + 1, which implies end - start + 1.
    Therefore, your formula should be:

    =MAX(0, MIN($C7+1, EDATE(D$2, 1)) - MAX($B7+1, D$2) + 1) / ($C7 - $B7 + 1) * A7
    Quang PT

  4. #4
    Registered User
    Join Date
    05-02-2024
    Location
    Vancouver
    MS-Off Ver
    Office 365
    Posts
    60

    Re: Cost apportionment / accrual period formula

    @alansidman

    Thanks for the reply. Something may have been missed in my communication.

    I'm looking at your file and for instance if we look at row 8, you've calculated wages of $934.07, but that period starts in Dec24 (Col B) and ends in Jan25 (Col C). The period we're trying to calculate for is in cell D2 & D3 (e.g. Mar25). Therefore the wages output for this row should be zero.

    Does that make sense?

    For example, row 14 should have an output because the period starts on 22nd Mar and ends on 4th Apr. Therefore 10 days worth of wages should be the output for this line.

  5. #5
    Registered User
    Join Date
    05-02-2024
    Location
    Vancouver
    MS-Off Ver
    Office 365
    Posts
    60

    Re: Cost apportionment / accrual period formula

    @bebo021999

    Thanks for the reply.

    I actually tried that, but the output isn't the same as calculating it manually.

    E.g. let's take row 14 for example. 10 days fall in March, and the total is 2369.23 (so $233.52 daily).

    If you calculate this manually, it would be 10 x 233.52 = 2,553.20. But using your calc we get $2,101.65.

    Can you see what I'm talking about?

    I can't for the life of me work out what's going on here!

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,400

    Re: Cost apportionment / accrual period formula

    Try pasting the following into cell D7 and then copying down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    05-02-2024
    Location
    Vancouver
    MS-Off Ver
    Office 365
    Posts
    60

    Re: Cost apportionment / accrual period formula

    This worked! Thank you!

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,400

    Re: Cost apportionment / accrual period formula

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

  9. #9
    Registered User
    Join Date
    05-02-2024
    Location
    Vancouver
    MS-Off Ver
    Office 365
    Posts
    60

    Re: Cost apportionment / accrual period formula

    I have an adjustment I need in the formula!
    Atm the formula works for positive amounts, but when there's a negative amount in there it outputs a completely wrong number.
    Are you able to please adjust the formula so that it works for negative amounts as well as positive amounts?
    Thanks!

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,400

    Re: Cost apportionment / accrual period formula

    Please provide examples.

  11. #11
    Registered User
    Join Date
    05-02-2024
    Location
    Vancouver
    MS-Off Ver
    Office 365
    Posts
    60

    Re: Cost apportionment / accrual period formula

    Apologies! Please see attached.

    Essentially the formula won't accrue negative numbers, only positive numbers. For a negative number it just outputs zero, but I would like for it to accrue the negative number in the same way it does the positive.

    Thanks!
    Attached Files Attached Files

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,400

    Re: Cost apportionment / accrual period formula

    This will yield a negative amount when dragged down from cell D7 to cell D8:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.

  13. #13
    Registered User
    Join Date
    05-02-2024
    Location
    Vancouver
    MS-Off Ver
    Office 365
    Posts
    60

    Re: Cost apportionment / accrual period formula

    Thats the one. Perfect! Thank you!

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,400

    Re: Cost apportionment / accrual period formula

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

  15. #15
    Registered User
    Join Date
    05-02-2024
    Location
    Vancouver
    MS-Off Ver
    Office 365
    Posts
    60

    Exclamation Re: Cost apportionment / accrual period formula

    Apologies. There is still one instance in which this does not work.

    Where the amount is a negative number, and the period start & end dates fall outside the accrual date, it outputs an amount when it should just be zero.

    See file attached - thx!
    Attached Files Attached Files

  16. #16
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,400

    Re: Cost apportionment / accrual period formula

    It seems as if the period start & end dates fall outside the accrual date that both positive and negative amounts should produce an output of zero.
    Put the following into cell D7 and then drag the fill handle down to cell D8:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    To test copy the dates from cells D11:D12 into cells D4:D5.
    Let us know if you have any questions.

  17. #17
    Registered User
    Join Date
    05-02-2024
    Location
    Vancouver
    MS-Off Ver
    Office 365
    Posts
    60

    Re: Cost apportionment / accrual period formula

    That seems to fully work now. Thanks!

+ 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: 5
    Last Post: 07-07-2024, 09:26 PM
  2. Replies: 7
    Last Post: 01-30-2021, 06:47 AM
  3. [SOLVED] Formula required for Cost distribution over a period for current as well as future years
    By rehana402003 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-18-2019, 04:20 PM
  4. Calculating rental period and cost
    By JustMax in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-07-2019, 11:05 AM
  5. [SOLVED] Total Compensation (Cost Per Pay Period + Prorated)
    By sydney080 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-25-2019, 02:46 PM
  6. Cost of Goods Macro for New Period
    By Adam Schaefer in forum Excel General
    Replies: 0
    Last Post: 12-04-2014, 09:57 PM
  7. Apportionment Formula
    By HangMan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-13-2013, 09:05 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