CSV Pivot Table
Summarize CSV data by row, column, and aggregation fields
CSV Pivot Table — what it does
Build a cross-tabulation from a flat CSV: choose a row field, a column field, a value field and an aggregation, and the tool produces the matrix that summarises them. It is the spreadsheet pivot most reports are built on — sales by product and month, hours by person and project — without opening a spreadsheet application.
Worked example
Eight orders pivoted into quantity per region and product: row field region, column field product, value field qty, aggregation Sum.
Input — orders.csv
order_id,region,product,qty,unit_price,order_date 1001,East,Notebook,12,3.50,2026-01-04 1002,West,Stapler,3,8.99,2026-01-04 1003,East,Notebook,5,3.50,2026-01-05 1004,North,Pen box,20,2.10,2026-01-06 1005,West,Notebook,7,3.50,2026-01-06 1006,East,Stapler,1,8.99,2026-01-07 1007,North,Pen box,15,2.10,2026-01-08 1008,West,Desk lamp,2,24.00,2026-01-08
Output — pivot-table.csv
region,Notebook,Stapler,Pen box,Desk lamp East,17,1,, West,7,3,,2 North,,,35,
Combinations with no matching rows are left empty (East has no Pen box or Desk lamp orders), so a gap is not mistaken for a zero. Rows and columns appear in the order their values first occur in the file, and the download starts with a UTF-8 byte-order mark.
When this tool helps
- Turning a transaction log into a product-by-month revenue grid for a management report.
- Cross-tabulating survey responses by segment to see how answers differ between groups.
- Summarising hours by employee and project code straight from a timesheet export.
How to use it
- Choose the CSV file.
- Select the row field and the column field.
- Select the value field and the aggregation.
- Process and download the pivot result.
Accuracy, limits, and good practice
- Pick a column field with few distinct values. A field with hundreds of values produces a table too wide to read or print.
- Count works on any field, but sum and average need numeric values — check the column first if totals look wrong.
- Empty cells mean no rows matched that combination, which is itself informative: a gap in coverage, not a zero.
Frequently asked questions
How is this different from group and aggregate?
Grouping summarises along one dimension. A pivot summarises along two at once, giving a grid rather than a list.
Can I add more than one value field?
One at a time. Run the tool per measure and place the results side by side in a spreadsheet if you need several.
Can I open the result in Excel?
Yes. Download the CSV and open it, or run it through the CSV to Excel tool for a formatted XLSX workbook.
What does the No column grouping entry do?
The column field list starts with a No column grouping option. Choosing it produces a single column named Value with one total per row value — on this file East 18, West 12, North 35 — so the result is a one-dimensional summary like the group and aggregate tool, and it has no empty cells.
How are non-numeric value cells treated?
Count counts every row regardless of content. Sum and Average skip cells that are not numbers after thousands separators are removed, and Average divides by the number of numeric cells: with Average on this file East/Notebook shows 8.5 (12 and 5) while combinations without rows stay empty. A combination whose rows hold no numbers at all shows 0.
Related tools on this site
- CSV Row Filter — Keep CSV rows that match a selected rule
- HTML Table to CSV — Extract an HTML table and download it as a CSV file
- TSV & CSV Converter — Convert tab-separated data and CSV text in either direction
Further reading: Cleaning a CSV export before you import it anywhere · CSV, JSON, YAML, XML and Markdown Tables: When Each Fits and How to Convert
Everything above runs inside this page. CSV Pivot Table needs no account, no upload, and no server round trip — close the tab and nothing is left behind.
CSV 樞紐分析表能做什麼
把平面 CSV 做成交叉分析表:選定列欄位、欄欄位、數值欄位與彙總方式,工具就會產生對應的矩陣。多數報表底層用的正是這種樞紐分析——各產品各月份的業績、各成員各專案的工時——而且不必開試算表軟體。
實際範例
八筆訂單做成各地區、各產品的數量交叉表:列欄位 region、欄欄位 product、數值欄位 qty、彙總選加總。
來源:orders.csv
order_id,region,product,qty,unit_price,order_date 1001,East,Notebook,12,3.50,2026-01-04 1002,West,Stapler,3,8.99,2026-01-04 1003,East,Notebook,5,3.50,2026-01-05 1004,North,Pen box,20,2.10,2026-01-06 1005,West,Notebook,7,3.50,2026-01-06 1006,East,Stapler,1,8.99,2026-01-07 1007,North,Pen box,15,2.10,2026-01-08 1008,West,Desk lamp,2,24.00,2026-01-08
得到:pivot-table.csv
region,Notebook,Stapler,Pen box,Desk lamp East,17,1,, West,7,3,,2 North,,,35,
沒有任何列符合的組合會留空(East 沒有 Pen box 與 Desk lamp 的訂單),不會把缺口誤看成 0。列與欄依該值在檔案中首次見到的順序排列,下載檔開頭帶 UTF-8 BOM。
什麼時候用得上
- 把交易紀錄整理成「產品 × 月份」的營收表格,供管理報告使用。
- 依分群交叉分析問卷結果,看不同族群的答案差異。
- 直接從工時匯出檔彙總「員工 × 專案代碼」的時數。
使用步驟
- 選擇 CSV 檔案。
- 選定列欄位與欄欄位。
- 選定數值欄位與彙總方式。
- 執行處理並下載樞紐結果。
精確度、限制與實務建議
- 欄欄位請挑不重複值較少的欄位,若有上百個值,表格會寬到既難讀也無法列印。
- 計數適用於任何欄位,但加總與平均需要數值;總計看起來不對時請先檢查該欄。
- 空格代表沒有任何列符合該組合,這本身就是資訊:那是缺口,而不是零。
常見問題
跟分組彙總差在哪?
分組只沿單一維度彙總;樞紐同時沿兩個維度彙總,輸出是矩陣而非清單。
可以放多個數值欄位嗎?
一次一個。需要多個指標時請分次執行,再於試算表中並排放置。
結果可以用 Excel 開嗎?
可以,下載 CSV 直接開啟即可;也可再用 CSV 轉 Excel 工具產生排版好的 XLSX。
欄欄位清單最上面那個不分欄的選項是做什麼的?
選它會只產生一個名為 Value 的欄,每個列值一個合計,以這份檔案為例是 East 18、West 12、North 35。得到的是一維彙總,和分組彙總工具相同,而且不會有空格。
非數字的數值儲存格如何對待?
計數不看內容,每一列都算。加總與平均會略過去掉千分位後仍不是數字的儲存格,平均以數值儲存格的個數為分母:這份檔案改選平均時,East/Notebook 顯示 8.5(12 與 5),沒有資料列的組合仍留空。若某組合有列但沒有任何數字,則顯示 0。
本站相關工具
- CSV 資料篩選 — 依指定條件保留符合的 CSV 資料列
- HTML 表格轉 CSV — 提取 HTML 表格內容並下載為 CSV 檔案
- TSV 與 CSV 互轉 — 在 Tab 分隔資料與 CSV 文字之間轉換
延伸閱讀: 匯入之前先把 CSV 匯出檔清乾淨 · CSV、JSON、YAML、XML 與 Markdown 表格:各自適用的場合與轉換方法
以上步驟全部在這個頁面內完成,CSV 樞紐分析表 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。