Pivot Table Sum Positive And Negative Numbers Regardless Of Sign in Row Label Range

26,781

Well, it depends. The formula you've entered in the question can be achieved by using a Calculated Field. Just define a new Calculated Field for your pivot table with the formula =ABS(Sales Amount) and display that instead of Sum of Sales Amount.

However, if your raw data contains both positive and negative values for a specific sales agent you need to take a different approach. The above Calculated Field operates on the already summed raw data.

If we for example have the following raw data:

Name Value
A     3
A    -2
B     4
B    -5

Then we create a pivot table and add a Calculated Field AbsValue with the formula =ABS(Value) we get the following result

  Sum of Value Sum of AbsValue
A  1           1
B -1           1

To get a summation of all the absolute values from the raw data, you need to add a new column to the raw data and perform the ABS function there:

Name Value AbsValue
A     3    3
A    -2    2
B     4    4
B    -5    5

  Sum of Value Sum of AbsValue
A  1           5
B -1           9
Share:
26,781

Related videos on Youtube

Shiro
Author by

Shiro

Updated on September 18, 2022

Comments

  • Shiro
    Shiro over 1 year

    I am using Excel 2010, Pivot Table feature.

    I would like to sum up the range of agent total sales. The problem is some of the sales person has the credit note. It means it shows negative in the figure. I would like the sum positive and negative number regardless their sign.

    I manage to do it by manual enter {=SUM(ABS(B96:B102))} As the image show below.

    enter image description here

    However, My Pivot table is filter by monthly and product. Different filtering will have different row records. If I hard code the formula, it is not flexible as well. How can I make it flexible? I did try with GetPivotData, but it does not support by range.

    Anyone can help?

  • Shiro
    Shiro almost 12 years
    This is the alternative I did just now, I found out no way can direct access the pivot table range.