Skip to Content
Grouping by Number
shortcut

Grouping by Number

by Dawn Griffiths
August 2024
Beginner
5 pages
1m
English
O'Reilly Media, Inc.
Content preview from Grouping by Number

Grouping by Number

Problem

You have a PivotTable with a number field and want to group summary values by numeric ranges.

Solution

Suppose you have a PivotTable with Student and Score fields, where Score contains numeric values and Student contains text values, and you want to count how many students scored 1 to 10, 11 to 20, 21 to 30, and so on. You can do so by following these steps:

  1. In the PivotTable Fields pane, drag the Score field to the Rows section and the Student field to the Values section.

  2. Select one of the Score cells in the PivotTable; then choose PivotTable Analyze ⇒ Group ⇒ Group Selection to open the number Grouping dialog box.

  3. In the Grouping dialog box, use the Starting At and Ending At boxes to specify the lower and upper limits of the groups and the By box to specify the interval for each group. To group values from 1 to 100 where the interval for each group is 10, you’d type 1 in the Starting at box, 100 in the Ending At box, and 10 in the By box.

  4. Click OK to apply the changes to the PivotTable (see Figure 1).

    Screenshot of dialog box and PivotTable
    Figure 1. The Grouping dialog box for number fields and the corresponding PivotTable

To remove the groups, select a cell containing one of the group’s items, then choose PivotTable Analyze ⇒ Group ⇒ Ungroup.

Discussion

This recipe is similar to Recipe 11.16 except that it shows ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Using Calculated Fields to Count Items

Using Calculated Fields to Count Items

Dawn Griffiths
Grouping by Date/Time

Grouping by Date/Time

Dawn Griffiths

Publisher Resources

ISBN: 9781098171001