Pivot table and group-by summarizer
Paste a table with one row per record. Choose what to group by, what to measure and how to combine it. The summary, with totals, appears below and can be copied or downloaded as CSV.
Sum of Revenue by Region and Product
| Region | Backpack | Notebook | Pen set | Total |
|---|---|---|---|---|
| East | 572 | 164 | 182 | 918 |
| North | 704 | 300 | 364 | 1,368 |
| South | 484 | 212 | 266 | 962 |
| West | 396 | 252 | 168 | 816 |
| Total | 2,156 | 928 | 980 | 4,064 |
How to use it
- Paste data in long format: one row per record, one column per attribute. A sales export, a list of survey responses or a log of expenses are all in this shape already.
- Choose the column whose values become the rows of the summary, such as region.
- Optionally choose a second column to spread across the top, such as product. Leave it at "(none)" for a plain group-by with one result per group.
- Choose the value column and how to combine it. Sum and average need numbers; the counts do not.
- Copy the result as CSV to paste into a spreadsheet, or download it.
What each aggregation does
| Option | Result for each group |
|---|---|
| Sum | Total of the numeric values |
| Count of rows | How many records, blank values included |
| Average (mean) | Sum ÷ number of numeric values |
| Median | Middle numeric value |
| Minimum / Maximum | Smallest / largest numeric value |
| Count of distinct values | How many different non-blank values |
Totals are always computed from the original rows, never from the cells of the summary. For a sum or a count the two agree anyway. For an average, median, minimum, maximum or distinct count they do not, and only the first is correct. The distinct count is the clearest case: three regions that each sold notebooks add up to one distinct product, not three.
Worked example
The sample ledger has 20 orders across four regions and three products. Summing revenue by region and product gives 12 cells. North sold the most, 1,368 in total, of which 704 came from backpacks. Across all regions backpacks brought in 2,156 of the 4,064 total, more than half, even though only 49 were sold. Switch the values to Units and the picture reverses: 280 pen sets and 232 notebooks against 49 backpacks.
Now clear "Spread across columns", group by Product and choose Average. Each backpack order averaged 359.33, notebooks 116 and pen sets 163.33. The Total row shows 203.20, which is 4,064 divided by 20 orders. The mean of the three product averages would be 212.89, a figure that describes nothing, because the products have different numbers of orders.
Limits
Grouping is by exact text after trimming spaces, so "North", "north" and "N." are three groups. Dates are grouped as text, one group per distinct date. There are no calculated fields, filters or percentage-of-total views; for those, copy the result into a spreadsheet. The tool handles tens of thousands of rows comfortably in a modern browser, but very large pastes can make the text box itself slow. Opening the file with the file picker is faster than pasting.
To chart the result, copy it and paste it into the bar chart tool (the totals come along, so delete the Total line and untick the Total column there), or into the pie chart maker for shares of a single total.
Common questions
What is a pivot table?
A summary of a long table by category. You choose a column to group by, optionally a second column to spread across the top, a column of values and a way to combine them, such as sum or average. Each cell of the result is that combination applied to the rows that share both labels. Spreadsheets call the same operation a pivot table; databases call it GROUP BY.
Why is the average in the Total row not the average of the averages?
Because that would be wrong whenever the groups have different sizes. The total is computed from the underlying rows directly: the overall average revenue is total revenue divided by the number of sales, not the mean of the per-product means. The same applies to the median, minimum and maximum.
What happens to blank or text values?
For sum, average, median, minimum and maximum, only cells that read as numbers are used; the tool tells you how many were not numbers. Count of rows counts every row in the group, blank or not. Count of distinct values ignores blanks. A blank in a grouping column becomes its own group, labelled "(blank)".
Are "North" and "north" the same group?
No. Labels are matched exactly, apart from leading and trailing spaces, which are trimmed. If your data mixes spellings or capitalisation, tidy it first, or you will see the same category split across several rows of the pivot.
Can I pivot on dates by month?
Not directly: a date column is grouped by its exact text, so every distinct date is its own group. Add a column holding just the month (for example 2026-01), in your spreadsheet or by editing the pasted text, and group by that.
Other tools
- CSV cleaner How do I clean up this messy CSV export?
- CSV to bar or line chart How do I turn this spreadsheet into a chart quickly?
- Pie and donut chart maker What share of the total is each category?
- Histogram maker How many bins should my histogram have?
- Scatter plot with linear regression Are these two numbers related, and how strongly?
- Summary statistics calculator What are the mean, median and outliers of this data?
- CSV to Markdown and HTML table converter How do I put this spreadsheet in a README or web page?
- JSON to CSV converter (and back) How do I open this JSON export in a spreadsheet?