Pivot table Count/Sum

Sigh

Active Member
Joined
Oct 24, 2007
Messages
379
Whenever I create a Pivot Table I inevitably have to change the calculations in the table from Count to Sum, is there a way to program it so that it defaults to Sum?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
You probably have blank cells, errors or text values. Try the following clean up code on a copy of your data:

Code:
Sub Convert_to_Number()
Dim r As Range, cell As Range
Set r = [b131:b145]                         ' range of interest
For Each cell In r
    If IsError(cell) Then cell = 0
    If Not WorksheetFunction.IsFormula(cell) Then cell = Replace(cell, """", "")
    If WorksheetFunction.IsLogical(cell) Then cell = Abs(cell)
    If WorksheetFunction.IsText(cell) Then
        On Error Resume Next
        cell = CDbl(cell)
        If Err.Number <> 0 Then cell = 0    ' this text is not a number
        Err.Clear
        On Error GoTo 0
    End If
    If Len(cell) = 0 Then cell = 0          ' empty cell
Next
r.NumberFormat = "0.0"
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top