+ Reply to Thread
Results 1 to 17 of 17

Add calculated item to pivot table

Hybrid View

tony0710 Add calculated item to pivot... 06-21-2009, 05:41 PM
rylo re: Add calculated item to... 06-22-2009, 01:29 AM
tony0710 re: Add calculated item to... 06-22-2009, 11:57 AM
rylo re: Add calculated item to... 06-22-2009, 06:26 PM
tony0710 re: Add calculated item to... 06-24-2009, 04:54 PM
  1. #1
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106

    Add calculated item to pivot table

    Dear All

    Attached is a worksheet example, of my beauty salon with 5 therapists.

    The input sheet - is the shhet into which I input data on a daily basis.

    Weekly inc - This sheet shows the total that each therapist made in apivot table based on the input. The week numbers are 1 to 52 (or 53) depending on each financial year (07/08, 08/09 etc).

    What I want to do is either have another pivot table or to add an calculated item to the weekly inc pivot table showing me how much commission each therapist took each week? This is to be done automatically by excel.

    This commission is calcluated by using the target comm figures - E.G. Leanne's target is £480 - so she has to earn £480 a week before getting a commission. So if in a week she earns £500 - she will get a commission on £20 (£500 - £480). The commission is 10%, so she will earn £2 that week.

    Any help would be much appreciated.
    Attached Files Attached Files
    Last edited by tony0710; 07-08-2009 at 10:22 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    re: Add calculated item to pivot table

    Hi

    As you have some formula in the input sheet, how about adding some additional formulas that will work out the commission, and you could then add those to the pivot table.

    Using your example file sheet Input
    K1: *** Sales
    L1: Commission Target
    M1: Commission
    K2: =SUMPRODUCT(--($B$2:B2=B2),--($G$2:G2=G2),($D$2:D2))
    L2: =VLOOKUP(B2,'Com Target'!$A$2:$B$7,2,FALSE)
    M2: =IF(K2>L2,(K2-L2)*0.1,0)

    Copy from K2:M2 down and this will give you the relevant commission per sale.

    HTH

    rylo

  3. #3
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106

    re: Add calculated item to pivot table

    Thanks

    Had to tweak formula as follows:

    K2:=SUMPRODUCT(--($B$2:B2=B2),--($G$2:G2=G2),--($H$2:H2=H2),($D$2:D2))

    This took into account the particular quarter.

    Still got a problem tho:

    Using the above formula gives me a running total - but as soon as the total goes over the target com - Cell M is populated according to formula:

    M2: =IF(K2>L2,(K2-L2)*0.1,0)

    Then in the pivot table I get a total of the values above the target com - see attached revised worksheet.

    What I need is a way of recording the Max value found using the sumproduct formula above in the pivot table and to ignore the other values for that member of staff on a particular week.

    Regards
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    re: Add calculated item to pivot table

    Hi

    Sorry, I missed a bit.

    M3: =IF(K3>L3,(K3-L3)*0.1-SUMPRODUCT(--($B$2:B2=B3),--($G$2:G2=G3),($M$2:M2)),0)

    Copy from M3 down as required.

    rylo

  5. #5
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106

    re: Add calculated item to pivot table

    Thanks Rylo

    But this has still not worked!

    This still does not erdicate the value in col M when value in col K is NOT the highest for that therapist in that week.

    Using the above formula you suggested and placing it in M3, then selecting it and using the corner handle to copy it down col M - I still get Row 17 showing that Aimee made £714.10 on 08/06/07 (week 2 of yr 07/08 Q1) and there is a value in M17 as 714.10 is above 600 - but this should be "zero", as this is not the MAX value that Aimee has earned in week 2 of Yr 07/09 Q1 - in fact her Max value was earned on Row 20 (09/06/07) - that also has a value in M20.

    The pivot table adds the values of M17 and M20 to give 24.98 - when infact her total commission for the week is value in M20 only i.e. 13.57.

    still needs more teaking - the formula:

    M17: =IF(K17>L17,(K17-L17)*0.1-SUMPRODUCT(--($B$2:B16=B17),--($G$2:G16=G17),($M$2:M16)),0)
    M20: =IF(K20>L20,(K20-L20)*0.1-SUMPRODUCT(--($B$2:B19=B20),--($G$2:G19=G20),($M$2:M19)),0)

    Are these correct?

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    re: Add calculated item to pivot table

    Hi

    Aimee's total sales for week 2 is 849.80 as shown in K20. So here commission for the week should be 24.98. If you add the values from M17 and M20, you get 24.98.

    What this formula is doing is showing in column M the commission component for each of the sales when here total sales is over the threshold. It doesn't try to find the max sales value and only apply the commission to that entry.

    As you are using a pivot table, which will add all the commissions, I didn't thing that this would be an issue.

    Your original brief wanted

    What I want to do is either have another pivot table or to add an calculated item to the weekly inc pivot table showing me how much commission each therapist took each week?
    I've taken the pivot table option which will add all the commission components and give the total commission for the therapist for the week.

    Can you check that the total commision when totaled for each week is correct?

    rylo

+ 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