tags:

views:

166

answers:

2

In Excel, what is the difference between

SUBTOTAL (9, myrange)

and

SUM (myrange) ?

+2  A: 

According to Microsoft, there is no difference, although SUBTOTAL() is more flexible since it has the option of including or ignoring hidden values. I wouldn't be surprised if SUM() (and others like AVERAGE() and STDEV()) were implemented in terms of SUBTOTAL().

In silico
+3  A: 

The big difference between SUBTOTAL and SUM is that SUBTOTAL can be used repeatedly in the same column for section subtotals and then used again at the end for a grand total. SUBTOTAL(9, myrange) excludes other SUBTOTAL-calculated values within myrange. SUM does not exclude anything, so if you have section subtotals, and use SUM(myrange) for your grand total, your grand total will be double what it should be (since it has counted the "naked" row values in myrange as well as the section subtotals that lie within myrange).

John Y
Well said.http://www.dailydoseofexcel.com/archives/2008/01/04/subtotals-ignoring-subtotals/
Dick Kusleika