=PIVOTBY(data, pivot_range, [value_range], [criteria])One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
Need more than a single PIVOTBY formula? Try our free AI for Excel — it reads your entire spreadsheet, answers questions in plain English, and builds charts and analysis in the same chat.
data:
The range of cells that contains the data you want to analyze with the pivot operation.
pivot_range:
The range of cells that defines the pivot table structure, including the rows and columns for summarization.
value_range:
The range of cells that contains the values to be aggregated in the pivot table. This parameter is optional; if omitted, the function will use the data range.
criteria:
The condition or criteria that determines which data to include in the pivot operation. This parameter is optional and can be a number, text, expression, or a cell reference.
The PIVOTBY function in Excel is a versatile tool that allows you to create a pivot table-like summary of data based on specific criteria. It enables you to aggregate and analyze data dynamically, making it easier to derive insights from large datasets.
In simpler terms, the PIVOTBY function helps you summarize data by grouping it according to specified dimensions, allowing for quick analysis and reporting.
Imagine you are managing a product sales report for a retail store, and you have the following data in an Excel spreadsheet:
| Product | Sales Amount | Category |
|---|---|---|
| Widget A | 200 | Gadgets |
| Widget B | 150 | Gadgets |
| Widget C | 300 | Tools |
| Widget D | 250 | Tools |
| Widget E | 100 | Gadgets |
You want to find the total sales for each product category.
To calculate the total sales for each category, you would use the PIVOTBY formula as follows:
=PIVOTBY(B2:B6, C2:C6)When you apply the formula, it summarizes the sales amounts for each category. The output would be:
| Category | Total Sales |
|---|---|
| Gadgets | 450 |
| Tools | 550 |
Here, the total sales amount for Gadgets is calculated as 200 (Widget A) + 150 (Widget B) + 100 (Widget E) = 450, and for Tools as 300 (Widget C) + 250 (Widget D) = 550.
The PIVOTBY function is particularly useful when you need to summarize and analyze data quickly without creating complex pivot tables. It allows you to dynamically aggregate data based on specified criteria, making it easier to generate reports and insights.
Understanding how to use the PIVOTBY function can significantly enhance your data analysis capabilities in Excel, enabling you to extract meaningful insights from your datasets.
Happy analyzing!
You have a table where Column A contains product categories, Column B contains sales figures, and Column C contains regions. You can use the PIVOTBY function to analyze the total sales for each product category across different regions. This allows for a clear visualization of sales performance by category and region, enabling better inventory management and targeted marketing strategies without the need for complex data manipulation.
Beyond the PIVOTBY function: Better Analyst is a full Excel AI that goes well past individual formulas. Upload any spreadsheet and ask questions in plain English — you'll get formulas, data analysis, and charts back in seconds. It's a free AI Excel assistant that works with any .xlsx, .xls, or .csv file — no plugins, no Microsoft 365 required.
Don't have a spreadsheet yet? Use our free AI spreadsheet generator to turn a text prompt into a downloadable Excel file — a full AI Excel sheet maker that builds headers, columns, and formulas from your description.
Create a free account for formula help, explanations, and spreadsheet analysis. Usage limits depend on your plan.
Browse our complete library of Excel formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.