How to Group Data in Excel by Range

Cody Schneider8 min read

Wrangling a long list of numbers in Excel can feel overwhelming, especially when you're trying to spot trends. Grouping that raw data into ranges - like bucketing customer ages into "20-29" or sales deals into "$0-$1000" - is the key to turning a cluttered spreadsheet into a clear story. This article will show you two effective and straightforward methods to group your numerical data in Excel: one using simple formulas and another using the powerful PivotTable feature.

Why Group Data into Ranges?

Before jumping into the "how," let's quickly cover the "why." You spend less time squinting at individual rows and more time understanding the big picture. When you group data, you can:

  • Simplify Large Datasets: Condensing thousands of rows into a handful of categories makes your data instantly more digestible. Instead of analyzing 5,000 individual purchase amounts, you can see how many sales fell into brackets like "$0-$50," "$51-$100," and so on.
  • Identify Patterns and Distributions: Are most of your customers in their 30s? Is your most popular product priced between $25 and $50? Grouping data immediately reveals these distributions, helping you understand where the action is.
  • Create Clearer Visualizations: Grouped data is the foundation for effective charts like histograms or column charts. Charting ranges instead of individual data points tells a much clearer story and keeps your visuals from becoming cluttered and unreadable.

This is a fundamental step in data analysis whether you're looking at website session durations, product inventory levels, survey results, or sales cycle lengths. It’s all about creating structure from chaos.

Method 1: Using Formulas like COUNTIF and COUNTIFS

The formula-based approach is perfect when you want complete control over your report's layout or when your data doesn’t change often. It's manual but very transparent - you can see exactly how each number is calculated. Let's use an example of grouping a list of "Test Scores" into grade brackets.

Imagine you have a list of scores in Column B, from B2 to B51.

Step 1: Set Up Categories and Bins

First, decide on your ranges and write them down in a separate area of your sheet. This keeps things organized. For our test scores, we’ll create categories for grades F through A. It’s also helpful to create a "Bins" column that represents the upper limit for each range. This will make our formulas much easier to write and read.

You might set it up like this starting in cell D2:

  • E2: F (Score: 0-59)
  • F2 (Bin): 59
  • E3: D (Score: 60-69)
  • F3 (Bin): 69
  • E4: C (Score: 70-79)
  • F4 (Bin): 79
  • E5: B (Score: 80-89)
  • F5 (Bin): 89
  • E6: A (Score: 90-100)
  • F6 (Bin): 100

Step 2: Calculate the Count for the First Range

For the lowest group ("F" grade, scores up to 59), we only need one condition: "is the score less than or equal to 59?" The COUNTIF function is perfect for this. In the cell next to your "F" category (let's say G2), you would type:

=COUNTIF($B$2:$B$51, "<="&F2)

Let's break that down:

  • $B$2:$B$51 is our list of test scores. We use dollar signs ($) to lock the range so it doesn’t change when we drag the formula down later.
  • "<= "&F2 tells Excel to count any cell where the value is less than or equal to the value in cell F2 (which is 59).

Step 3: Calculate Counts for the Middle Ranges with COUNTIFS

For the "D" grade (scores from 60 to 69), we have two conditions: the score must be greater than 59 AND less than or equal to 69. For multiple criteria, we need to use the COUNTIFS function (with an 'S').

In cell G3, you will use a different approach. You cannot simply count everything up to 69, because that would also include the "F" grades you've already counted. Instead, we can calculate the total number of scores up to 69 and then subtract the count of the previous category.

In cell G3, enter:

=COUNTIF($B$2:$B$51, "<="&F3) - COUNTIF($B$2:$B$51, "<="&F2)

Here’s the logic:

  • COUNTIF($B$2:$B$51, "<="&F3) counts all scores up to 69.
  • Subtracting COUNTIF($B$2:$B$51, "<="&F2) (scores up to 59) leaves only scores between 60 and 69.

You can drag this formula down from G3 to G6, and it will correctly calculate the count for each grade bracket by removing the counts of the preceding brackets.

Pros and Cons of the Formula Method

Pros:

  • Full Layout Control: You can place your summary table anywhere in your workbook and format it exactly how you like.
  • Updates Automatically (with static ranges): If a test score changes within the range B2:B51, the counts will update instantly.

Cons:

  • Manual Setup: Setting up the bins and formulas takes time, especially with many categories.
  • Less Dynamic for New Data: If you add new scores below row 51, you must manually update the ranges in every single formula or use a more advanced trick like converting your data to a Table.

Method 2: Grouping Data with a Pivot Table

If you're looking for speed, efficiency, and interactivity, Pivot Tables are the way to go. This method automates the grouping process and is incredibly flexible if you decide to change your ranges later.

Let's use a different dataset: a list of customer ages in Column C.

Step 1: Insert a Pivot Table

First, click anywhere inside your data. Then go to the Insert tab on the Ribbon and click PivotTable. Excel will automatically select your data range, and you can choose to place the PivotTable in a new worksheet or an existing one. A new worksheet is usually best to keep things clean.

Step 2: Set Up the Pivot Table Fields

Once the PivotTable is created, a "PivotTable Fields" pane will appear on the right side of your screen. To group by age, you need to:

  1. Drag the "Age" field from the field list into the Rows area at the bottom.
  2. Drag the "Age" field again into the Values area.

Excel will then list every unique age in the Rows area. The Values area should default to "Count of Age." If it shows "Sum of Age," simply click on it, choose "Value Field Settings," and change the calculation to Count.

Step 3: Group the Field

This is where the magic happens. Right-click on any of the age values in your new PivotTable. From the menu that appears, select Group.

Step 4: Define Your Range and Interval

A "Grouping" dialog box will pop up. Here, you have three key options:

  • Starting at: Excel usually detects the minimum value, but you can override it. Let's start at 20.
  • Ending at: Similarly, Excel detects the maximum value. Let's end at 70.
  • By: This is the most important setting. It defines the size of your range or interval. If you want to group ages by decade (20-29, 30-39, etc.), you would enter 10 here.

Click OK. Your PivotTable will instantly transform from a long list of individual ages into clean, consistent groups with a count for each one. If you want to change your grouping - say, from 10-year intervals to 5-year intervals - you can just right-click again, choose "Group," and change the "By" value to 5.

Pros and Cons of the Pivot Table Method

Pros:

  • Extremely Fast: It takes seconds to create elegant data summaries.
  • Fully Dynamic: If you add new customer ages to your source data, just right-click the PivotTable and hit "Refresh." All the groups will update automatically (especially if your source data is an Excel Table).
  • Flexible: You can change the group interval ("By") on the fly to explore your data at different levels of detail.

Cons:

  • Less Layout Control: Pivot Tables have a rigid structure that you can modify, but you don't have the same free-form control as with the formula-based method.
  • Initial Learning Curve: If you've never used a Pivot Table, the field pane can be slightly intimidating at first.

Final Thoughts

Grouping data by range is a foundational skill in Excel that takes your analysis to the next level. For quick, dynamic summaries, Pivot Tables are unbeatable. For custom reports where layout control is a priority, the COUNTIF and COUNTIFS functions provide all the flexibility you need. Choosing the right method depends on your specific goal and how often your data changes.

Manually wrangling data in spreadsheets - whether it's setting up complex grouping formulas or building PivotTables from scratch - is exactly the kind of repetitive work we're trying to eliminate. At Graphed, we've built a tool where you can simply connect your data sources (like Google Analytics, Shopify, or even a Google Sheet) and use natural language to get your report. Instead of these manual steps, you can just ask, "Show me a chart of sales by deal size in increments of $1000." You get a live, automated dashboard in seconds, not a static report, allowing you to focus on discovering insights instead of configuring them. You can give Graphed a try and see how easily you can get answers from your data.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.