englishrob
New Member
- Joined
- May 17, 2010
- Messages
- 22
What would be the best way to count the number of occurrences of each value in a column?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
I tried to create a pivot table, but could only get it to work if I placed a 1 in the adjacent cell next to each value, i.e. another column. I can figure it out using procedural style code in VBA (test for change of value in cell below) but guess there must be a better way using ranges. I’m ok with VBA but not done much on Pivot Tables.<o></o>
<o></o>
Sample data:<o></o>
<o></o>
Sun<o></o>
Sun<o></o>
Sun<o></o>
Sun<o></o>
<o></o>
To show 4 next to the last Sun<o></o>
<o></o>
Mon<o></o>
Mon<o></o>
<o></o>
To show 2 next to the last Mon<o></o>
<o></o>
Tue<o></o>
Tue<o></o>
Tue<o></o>
Tue<o></o>
Tue<o></o>
Tue<o></o>
Tue<o></o>
<o></o>
To show 7 next to the last Tue<o></o>
<o></o>
Thanks<o></o>
<o></o>
<o></o>
I tried to create a pivot table, but could only get it to work if I placed a 1 in the adjacent cell next to each value, i.e. another column. I can figure it out using procedural style code in VBA (test for change of value in cell below) but guess there must be a better way using ranges. I’m ok with VBA but not done much on Pivot Tables.<o></o>
<o></o>
Sample data:<o></o>
<o></o>
Sun<o></o>
Sun<o></o>
Sun<o></o>
Sun<o></o>
<o></o>
To show 4 next to the last Sun<o></o>
<o></o>
Mon<o></o>
Mon<o></o>
<o></o>
To show 2 next to the last Mon<o></o>
<o></o>
Tue<o></o>
Tue<o></o>
Tue<o></o>
Tue<o></o>
Tue<o></o>
Tue<o></o>
Tue<o></o>
<o></o>
To show 7 next to the last Tue<o></o>
<o></o>
Thanks<o></o>
<o></o>