+ Reply to Thread
Results 1 to 11 of 11

Looking for more efficient method of dividing actual spends

  1. #1
    Registered User
    Join Date
    04-15-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    7

    Looking for more efficient method of dividing actual spends

    Hi, I'm attaching a generic sheet with a sample of what I'm trying to do. I'm definitely a beginner when it comes to Excel.

    Sample-Coding-Spreadsheet.xlsx

    In the "Jan" workbook, I'll be adding invoices with actual expenditures. The company I work for has four companies. We split the expenses between the companies and depending on the type expenditure (i.e., advertising, supplies, etc.), the percentages vary.

    In the "CodingRates" workbook, I have the different types of spend and each column represents a company and what percentage of the expense they are paying for.

    In the Jan workbook (in columns J, K, L, and M) I would like the Actual to be multiplied by the percentage in the CodingRates workbook. So for row 2, the spend was Advertising and Company 1 would pay for 65%, Company 2 would pay for 10% and Company 3 would pay for 25%.

    I tried using an IF statement to grab the correct percentage based on Coding, but it is not a very efficient method since I have to manually update the formula for every cell.

    =IF(I2="Advertising", [@Actual]*'CodingRates'!B2, (if(I2="Supplies", [@Actual]*'CodingRates'!B3, (if(I2="Subscription", [@Actual]*'CodingRates'!B4, 0)))))

    The problem is if I have to include more Coding types, then I have to keep adjusting these formulas manually. I also can't cut and paste the formula since the cells from the CodingRates sheet are static and never change. I'm sure there has to be a much easier method than this.

    Any help would be greatly appreciated.

    Thanks,
    -Sharon
    Last edited by anemptyroad; 04-19-2013 at 12:43 PM. Reason: solved

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Looking for more efficient method of dividing actual spends

    hi Sharon, welcome to the forum. this in J2 will give you the percentage:
    =VLOOKUP($I2,CodingRates!$A$2:$E$4,MATCH(J$1,CodingRates!$A$1:$E$1,0),0)

    you can then multiply the numbers with it. i suppose it's G2?
    =VLOOKUP($I2,CodingRates!$A$2:$E$4,MATCH(J$1,CodingRates!$A$1:$E$1,0),0)*$G2

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    04-15-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Looking for more efficient method of dividing actual spends

    This is fantastic, thank you so much!!

  4. #4
    Registered User
    Join Date
    04-15-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Looking for more efficient method of dividing actual spends

    Hmm, so I tried applying this formula to my actual spreadsheet. Some of the columns are a little different and the Coding Rates table is larger (A2:E9) , but now I'm getting a #N/A error.

    The new formula looks like this (without the multiplication for now). The only changes I made are in bold. $K2 is the Coding column and N$1 is the Company 1 column

    =VLOOKUP($K2,CodingRates!$A$2:$E$9,MATCH(N$1,CodingRates!$A$1:$E$1,0),0)

    What am I doing wrong?

    PS - The "Jan" workbook in my actual spreadsheet is formatted as a pivot table, I'm not sure if that makes a difference.
    Last edited by anemptyroad; 04-16-2013 at 12:46 PM. Reason: Added PS note

  5. #5
    Registered User
    Join Date
    04-15-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Looking for more efficient method of dividing actual spends

    ^^ Bump to see if I can get some help for this final piece I seem to be missing.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Looking for more efficient method of dividing actual spends

    Hard to say without looking at a spreadsheet (Go Advanced> Manage Attachments) but maybe

    Try to find out which part is giving you the error
    =MATCH(N$1,CodingRates!$A$1:$E$1,0)? maybe
    I would think that should be
    =VLOOKUP($K2,CodingRates!$A$2:$E$9,MATCH(N$1,CodingRates!$B$1:$E$1,0),0)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Registered User
    Join Date
    04-15-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Looking for more efficient method of dividing actual spends

    I'm trying to learn more about the Match function and Vlookup function to so I can troubleshoot what is wrong. I guess I don't understand, why in the vlookup function, why the table array is $A$2:$E$9, but in the Match function, the table array is only $a$1:$e$1?

  8. #8
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Looking for more efficient method of dividing actual spends

    Hello,

    A typical VLOOKUP will look like this
    =VLOOKUP(Lookup_Value, Table_Array, Column_No, [Not_exact_match])
    What it does is "Vertically lookup" your Lookup_Value in the column number Column_No, and return exact match or approximate match (basing on Lookup_Type, if omitted it will be "True" by default, meaning approximate looking).
    In your formula, however, you use MATCH to find the Column_No, thus you have another formula, hence it may have a different range to lookup for value. MATCH function was used to find the column where your value can be in, then return the distance from whichever column it starts (for example, if it starts at column A, and found it at C, it will return 3; if it starts at D, and found it at F, it will still return 3).

    Hope this help.
    (copy pasta from Ford)
    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

    Regards,
    Lem

  9. #9
    Registered User
    Join Date
    04-15-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Looking for more efficient method of dividing actual spends

    Okay, I took my actual spreadsheet and wiped out the data and just put in some filler data.

    I keep getting the #N/A in column N of the Jan workbook. Not sure what I'm doing wrong here.

    Sample - 2013 - Budgets.xlsx

  10. #10
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Looking for more efficient method of dividing actual spends

    you should make sure N1:Q1 of "Jan" is the same as B1:E1 of "CodingRates". 1st one currently is "ABC Cost ". 2nd one is "ABC". if you really have it in this format & do not wish to change, this will help:
    =VLOOKUP($K2,CodingRates!$A$2:$E$9,MATCH(LEFT(N$1,FIND(" ",N$1)-1),CodingRates!$A$1:$E$1,0),0)*$J2

    what i added in red extracts the text of "ABC Cost " before the 1st space

    also, if you need to mask the errors for row 8 & below:
    =IF([@Coding]="","",VLOOKUP($K2,CodingRates!$A$2:$E$9,MATCH(LEFT(N$1,FIND(" ",N$1)-1),CodingRates!$A$1:$E$1,0),0)*$J2)

  11. #11
    Registered User
    Join Date
    04-15-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Looking for more efficient method of dividing actual spends

    Thank you very much. This last fix resolved the issue.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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