+ Reply to Thread
Results 1 to 18 of 18

Lookup & Expense Allocation Formula

  1. #1
    Registered User
    Join Date
    09-10-2017
    Location
    United States
    MS-Off Ver
    2016
    Posts
    13

    Lookup & Expense Allocation Formula

    I'm trying to create a lookup function that looks up associated costs for certain cells and distributes them onto an expense sheet based on the month and evenly splits the costs based on how many units are allocated to it.

    1. Looks up Costs associated with Unit (Unit1,Unit2,Unit3, or Unit4)
    2. Adds associated costs to associated Month
    3. Evenly splits costs based on how many Units are in Unit Allocation list.

    Example:

    Worksheet "Renovation Expenses"
    Expense amount = $100
    Unit Allocation = Unit1, Unit2
    Date = 7/5/17

    Results wanted
    Worksheet "Financials"
    Cell: A July to show $50
    Cell: B July to show $50

    Other instances: If unit allocation shows "All" I want it to distribute to all units (A,B,C,D) evenly.

    Attached Excel File with wanted results posted.
    Attached Files Attached Files
    Last edited by chrapm1; 09-10-2017 at 11:30 AM. Reason: Changed unit names

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Lookup & Expense Allocation Formula

    You get better help on your question if you add a small excel file, without confidential information.

    Please also add manualy the expected result in your file.


    To Attach a File:

    1. Scroll down to the window below your post Additional Options
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    09-10-2017
    Location
    United States
    MS-Off Ver
    2016
    Posts
    13

    Re: Lookup & Expense Allocation Formula

    Thanks, attached file!
    Last edited by AliGW; 09-10-2017 at 11:47 AM. Reason: Unnecessary quotation removed.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Lookup & Expense Allocation Formula

    Are the unit names REALLY A B C & D? if so, this creates some problems because it will be fiddly to search for "A" and not also find "All"
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    09-10-2017
    Location
    United States
    MS-Off Ver
    2016
    Posts
    13

    Re: Lookup & Expense Allocation Formula

    No Unit names can be anything, I changed them to "Unit1, Unit2, Unit3, Unit4" but if that doesn't work as well then whatever makes the function easiest will do.
    Last edited by AliGW; 09-10-2017 at 11:48 AM. Reason: Unnecessary quotation removed.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Lookup & Expense Allocation Formula

    Chrapm1 - please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Lookup & Expense Allocation Formula

    I went ahead anyway. I do need a helper column, in Renovation Expenses, E3, copied down:

    =IF(C3="All",COUNTIF($I$3:$I$7,"<>All"),1+LEN(C3)-LEN(SUBSTITUTE(C3,",","")))

    then this in Financials, B3, copied across and down:

    =SUMPRODUCT((ISNUMBER(SEARCH($A3,'Renovation Expenses'!$C$3:$C$10))*(MONTH('Renovation Expenses'!$D$3:$D$10)=MONTH(1&B$2))*('Renovation Expenses'!$C$3:$C$10<>"All")*'Renovation Expenses'!$B$3:$B$10)/'Renovation Expenses'!$E$3:$E$10)+SUMPRODUCT(('Renovation Expenses'!$C$3:$C$10="All")*(MONTH('Renovation Expenses'!$D$3:$D$10)=MONTH(1&B$2))*'Renovation Expenses'!$B$3:$B$10/'Renovation Expenses'!$E$3:$E$10)
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-10-2017
    Location
    United States
    MS-Off Ver
    2016
    Posts
    13

    Re: Lookup & Expense Allocation Formula

    Glenn,

    How would I modify these formulas to allow month & year to be allocated? I'm trying to keep a master of all financial allocations on the same excel sheet and with this new year starting means months will start repeating. What formats will I have to change/add to have the month & year (ex. Jan 17')?

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Lookup & Expense Allocation Formula

    Show us how your layout will be modified, both in the source data and your expected results...

    maybe post a modified sheet???

  10. #10
    Registered User
    Join Date
    09-10-2017
    Location
    United States
    MS-Off Ver
    2016
    Posts
    13

    Re: Lookup & Expense Allocation Formula

    Attached is an example of the sheet I have "Financials" with the associated "Expenses" Sheet. "Wanted Financials" is the format I'm trying to achieve to be able to have multiple years on it.
    Attached Files Attached Files

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Lookup & Expense Allocation Formula

    1. helper modified to remove the 1's against blanks:
    =IF(A3="","",(IF(C3="All",COUNTIF($I$3:$I$7,"<>All"),1+LEN(C3)-LEN(SUBSTITUTE(C3,",","")))))

    Dates along top of desired results, changed to real dates and formatted as mmm-yy

    in B5, copied across/down all of 2017:
    =SUMPRODUCT((ISNUMBER(SEARCH($A5,Expenses!$C$3:$C$10))*(Expenses!$D$3:$D$10>=B$2)*(Expenses!$D$3:$D$10<=EOMONTH(B$2,0))*(Expenses!$C$3:$C$10<>"All")*Expenses!$B$3:$B$10)/Expenses!$E$3:$E$10)+SUMPRODUCT((Expenses!$C$3:$C$10="All")*(MONTH(Expenses!$D$3:$D$10)=MONTH(B$2))*Expenses!$B$3:$B$10/Expenses!$E$3:$E$10)

    then select all of 2017 and copy/paste onto 2018. It would be easier to manage with some dynamic named ranges on the source sheets. Do you know how to set these up? If not, in your real data , are the data the result of formulae elsewhere, or are these the directly entered/imported values?
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    09-10-2017
    Location
    United States
    MS-Off Ver
    2016
    Posts
    13

    Re: Lookup & Expense Allocation Formula

    The formula is directly imported onto the expense sheet. This attachment is great, however it seems the Dec-18 column is copying over from Dec-17 and I can't seem to see why this is happening. The expense that this is referring to is $5000 on 12/25/2017. Is this a result of the allocation to "All" or some other result?

    Thanks so much for the help.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Lookup & Expense Allocation Formula

    It's 'cos I'm a tube... look back in a moment.

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Lookup & Expense Allocation Formula

    Fixed. The totals were wrong, too. But that was your mistake, not mine!! Also fixed.
    Attached Files Attached Files

  15. #15
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Lookup & Expense Allocation Formula

    Hi, to all!

    I leave a similar approach in attach file.

    Sheet Expenses:
    [E3] : =IF(C3=""," ",IF(C3="All",COUNTA(I$3:I$7)-1,1+LEN(C3)-LEN(SUBSTITUTE(C3,",",""))))

    Sheet Wanted Financials:
    [B2:M2,O2:Z2] : Real date format with "mmm-yy"
    [B5] : =SUMPRODUCT(ISNUMBER(SEARCH($A5&",",Expenses!$C$3:$C$129&","))+ISNUMBER(SEARCH("all",Expenses!$C$3:$C$129)),--(TEXT(B$2,"mm-y")=TEXT(Expenses!$D$3:$D$129,"mm-y")),Expenses!$B$3:$B$129/SUBSTITUTE(Expenses!$E$3:$E$129," ",1))

    Check file. Blessings!
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    09-10-2017
    Location
    United States
    MS-Off Ver
    2016
    Posts
    13

    Re: Lookup & Expense Allocation Formula

    Great fix, thanks for the help Glenn and johnnmpl!!

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Lookup & Expense Allocation Formula

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  18. #18
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Lookup & Expense Allocation Formula

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Sum-up weekly allocation to Monthly Allocation
    By juan.doe in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-11-2017, 04:41 AM
  2. Allocation Formula
    By Andrrewc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-21-2014, 05:09 PM
  3. Assistance with an allocation formula
    By Andrrewc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2014, 04:31 AM
  4. Lookup/Index type formula to Calculate Marginal Expense
    By Cidona in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-30-2010, 07:04 PM
  5. Lookup Allocation
    By amuljha in forum Excel General
    Replies: 2
    Last Post: 09-23-2010, 06:44 AM
  6. Material Allocation Formula
    By tl1735 in forum Excel General
    Replies: 1
    Last Post: 05-25-2010, 07:55 PM
  7. Replies: 3
    Last Post: 09-13-2005, 06: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