Microsoft Excel - pivot table calculations

Asked By DGL Smith on 24-Jan-10 01:36 PM

Do the pivot table calculations have the capability to count distinct values?  I believe distinct is the term I am referring to.

I have data that contains PO numbers.  Each PO can contain one line of data or numberous lines of data. 

By creating a pivot table, I can sum my PO amounts but when I count the PO's it counts each line as a value. 

Example,

PO 123   line one = $2.00

PO 123 line two = $3.00

PO 123 line three = $5.00

Pivot table sums my PO to $10.00. Perfect for what I need to do.  However, I need my pivot to count my PO's, not PO lines.  The above should be 1. But the pivot will count as 3.  Any ideas?

Thanks

Jonathan VH replied to DGL Smith on 25-Jan-10 09:30 AM

Hide the line detail and count the rows.  ;-)

Otherwise, I think I'd use a formula on the base data, not the pivot table, although you could create a formula outside the pivot table using the pivot table PO column range.  If you left the PO subtotals visible, you could count those (excluding the grand total row(s) from the range):

=COUNTIF(A5:A26,"* Total")

Otherwise, if you hide the subtotals, you could just use COUNT.

As with any formulas referring to pivot table ranges, you will have the problem of the range of the formula not changing as the pivot table is changed.