+ Reply to Thread
Results 1 to 8 of 8

Percentage in column D related to number in column C and subtotal in column B

  1. #1
    Registered User
    Join Date
    10-10-2016
    Location
    Belgium
    MS-Off Ver
    2019
    Posts
    45

    Percentage in column D related to number in column C and subtotal in column B

    Hello

    I have a large file (200000+ rows) for which I created a pivot table. In a calculated field in column D I would like to get a formula to calculate the percentage, based on a number in column C and a subtotal in column B.

    Example:

    Axes: Month, Colour, Days (difference between order date and delivery date)

    Column B: number of articles ordered, subtotal per month by pivot
    Column C: number of articles delivered, subtotal per month by pivot
    Column D: percentage of articles delivered in relation to subtotal of articles ordered

    Attached is a small dummy file.

    Any help is more than welcome.

    Thanks
    Chris
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Percentage in column D related to number in column C and subtotal in column B

    Here is your modified file.

    The first picture shows how to get to the calculated field insert, and the second shows the formula to use.

    Calc field.jpg
    Capture.JPG
    Attached Files Attached Files
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    10-10-2016
    Location
    Belgium
    MS-Off Ver
    2019
    Posts
    45

    Re: Percentage in column D related to number in column C and subtotal in column B

    Hello Bernie

    Thanks for your reply. I did what you did before, but then the result of the calculation is not as wanted.
    In the dummy file for the IND II color, the subtotal of ordered is 59 (cel B9), as sum of 58 pieces ordered (B10) on 1 day (A10) and 1 piece ordered (B11) on 5 days (A11).
    The formula now calculates the percentage of pieces delivered (column C) in relation of the pieces ordered (column B). As such the formula gives in D10 91,38%, being 53 delivered of 58 ordered.
    What I'm looking for is the percentage for 53 delivered (C10) of 59 (B9) and the percentage for 1 delivered (C11) of 59 (B9).
    This then should be calculated for each color (ie each subtotal and its corresponding rows: C15 and C16 to B14).

    Is this making any sense? Is this possible?

    Chris

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Percentage in column D related to number in column C and subtotal in column B

    How about a formula based on your pivot table, with a couple of changes to the pivot table....
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-10-2016
    Location
    Belgium
    MS-Off Ver
    2019
    Posts
    45

    Re: Percentage in column D related to number in column C and subtotal in column B

    This works fine, thanks.
    The problem I'm facing now is to get a chart from the combination of the pivot and the extra column added.
    Can I get a chart showing the color and the percentage?

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Percentage in column D related to number in column C and subtotal in column B

    You can create a data source for a chart by simple referencing the cells in the pivot table that you need, using simple formulas like

    =B3

    rather than the GetPivotData function. You may need to remove blanks, though, which is easy enough using another set of formulas.

  7. #7
    Registered User
    Join Date
    10-10-2016
    Location
    Belgium
    MS-Off Ver
    2019
    Posts
    45

    Re: Percentage in column D related to number in column C and subtotal in column B

    In the original file (over 200000 rows) I use slicers to filter the data in the pivot table, so the data to fill the chart change every time.
    The calculated percentage remains OK, but I don't succeed in putting this in a chart.
    I tried the simple formula as you suggested, but no result.
    Any help?

    Chris

  8. #8
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Percentage in column D related to number in column C and subtotal in column B

    This chart should change as the pivot chart changes.
    Attached Files Attached Files

+ 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: 3
    Last Post: 09-24-2015, 01:05 PM
  2. [SOLVED] Extract related data from a second column from repeated entries in a first column
    By pachorradas in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-31-2015, 02:41 PM
  3. [SOLVED] Marco for pivot table like fuctions. Subtotal column C, based on column B criteria.
    By RobertOHare in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-09-2013, 02:57 PM
  4. [SOLVED] Sum one column based on conditional count in a related column
    By DWSchuetz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-16-2012, 10:47 PM
  5. Replies: 3
    Last Post: 02-29-2012, 02:41 PM
  6. Replies: 0
    Last Post: 09-01-2009, 05:41 AM
  7. [SOLVED] move contents of column C based on criteria related to column A
    By Debra in forum Excel General
    Replies: 2
    Last Post: 12-27-2005, 06:30 PM

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