count distinct column values in pivot table?

jennxf

New Member
Joined
Jul 12, 2013
Messages
19
sentiment score
1
1
0.9
0.9
0.8
0.8
count
300
250
5
3
2
16

<tbody>
</tbody>
I have a pivot table here with columns equal to sentiment scores.

I would like to sump up distinct values for each sentiment score to get something like this:

sentiment score
1
0.9
0.8
count
550
8
18

<tbody>
</tbody>
Is this possible for excel 2011 for Mac?

Thanks!
J
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hello,

Using the "Sentiment score" as a pivot field should do just that (sum up per value).

So if you pull the "Sentiment score" field to the column label section of the pivot table, you should be fine.

If not, it may be that your scores, although displayed as similar values, are in fact slightly different behind the comma and Excel sees them as different values (for instance, the two 0.9 score may be 0.86 and 0.87).
> In number format, try displaying additional positions behind the comma to verify this.

Cheers,
drW
 
Upvote 0
Hi drW,

Yes the numbers are infact something like 0.87 or 0.86 but i already changed the entire column to 1 decimal place before transforming it to a pivot table. How can i ensure that excel doesnt see the hidden values?

Thanks!

Hello,

Using the "Sentiment score" as a pivot field should do just that (sum up per value).

So if you pull the "Sentiment score" field to the column label section of the pivot table, you should be fine.

If not, it may be that your scores, although displayed as similar values, are in fact slightly different behind the comma and Excel sees them as different values (for instance, the two 0.9 score may be 0.86 and 0.87).
> In number format, try displaying additional positions behind the comma to verify this.

Cheers,
drW
 
Upvote 0
Hello,

When you say you have changed the number before assembling them into the pivot table, do you mean that:
- you have changed its number format to display only one decimal?
- or that you have actually rounded up the number so that the number are exactly, mathematically, equal, i.e. they are exactly 0.9?

To verify what Excel "sees" in the pivot table, I'd recommend you change the number format of the sentiment score row in the pivot table (not in the source data) to display 3 decimals - this is to check whether the columns are different or not.

To effectively round up the source number to 1 decimal, use the ROUND function on your source data (in another column) as follows: = ROUND ( Number, 1)
- where 'Number' is your source number, and '1' is the number of decimal positions.

Then use this new column (containing the rounded up values) as the source data for your pivot field.

Does that work for you?

Cheers,
drW
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,746
Messages
6,132,476
Members
449,729
Latest member
davelevnt

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