Round() Function & Pivot Tables

Duvnjak

New Member
Joined
Aug 14, 2003
Messages
27
I'm using Excel 2007...does anyone know why the the sum of values for one column in my pivot table would differ from the total sum of my linked table?

I am using the Round(Rand()*100,0) function to determine the values for each cell in this one column. I notice that these values change each time I refresh the page (not sure why it does this). It seems as if the data in the pivot table is always one refresh behind.

i.e.

Table 3+4+5 = 12 (values 3, 4, and 5 are generated by the above function)
Pivot Table 2+3+4 = 9 (values 2, 3, 4 were the values found in the table before the Refresh was applied)

The pivot table should show the same values as found in the table

Thanks in advance to anyone who can help! I hope I was clear enough.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
The RAND function is volatile, so it updates each time the worksheet is calculated. Calculation doesn't automatically refresh a pivot table, that needs to be done manually. You could try this in the module for the worksheet:

Code:
Private Sub Worksheet_Calculate()
    Application.EnableEvents = False
    Me.PivotTables(1).PivotCache.Refresh
    Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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