Excel PIVOTBY function

Builds a full pivot table with a formula: rows, columns, values and totals. In Spanish Excel it is called PIVOTARPOR.

Syntax

English Excel

=PIVOTBY(row_fields, col_fields, values, function, [field_headers], [row_total_depth], [row_sort_order], [col_total_depth], [col_sort_order])

Spanish Excel (Mexico)

=PIVOTARPOR(campos_de_fila, campos_de_columna, valores, función, [encabezados_de_campo], [profundidad_total_de_fila], [orden_de_fila], [profundidad_total_de_columna], [orden_de_columna])

Spanish Excel (Spain, Latin America)

=PIVOTARPOR(campos_de_fila; campos_de_columna; valores; función; [encabezados_de_campo]; [profundidad_total_de_fila]; [orden_de_fila]; [profundidad_total_de_columna]; [orden_de_columna])

ArgumentWhat it is
row_fieldsWhat goes in the rows.
col_fieldsWhat goes in the columns.
valuesThe numbers to summarize.
functionSUM, AVERAGE, COUNT… without parentheses, or a LAMBDA.
field_headersoptionalWhether the ranges include headers.
row_total_depthoptional0 removes the Total row.
row_sort_orderoptional-1 sorts the rows descending.
col_total_depthoptional0 removes the Total column.
col_sort_orderoptional-1 sorts the columns descending.

Example

PIVOTBY(row_fields, col_fields, values, function) is a full pivot table: one row per value of the first field, one column per value of the second, and totals both ways. It recalculates by itself when the data changes, with no Refresh button.

=PIVOTBY(A2:A11,B2:B11,C2:C11,SUM)

Common mistake

Excel 365 only. Unlike a PivotTable, there is no Refresh button to press: it changes as soon as the data does.

About Ads

This site uses Google AdSense to display ads. These ads help us keep WebHerramientas completely free. Ads are managed by Google and meet strict security and privacy standards.

Advertising
Loading ad...

Ads help us keep WebHerramientas free for everyone

Practice PIVOTBY

Type the formula in the sheet and check it instantly. Spanish or English function names both work. See all lessons

PIVOTBY: rows and columns

PIVOTBY(row_fields, col_fields, values, function) is a full pivot table: one row per value of the first field, one column per value of the second, and totals both ways. It recalculates by itself when the data changes, with no Refresh button.

Example=PIVOTBY(A2:A11,B2:B11,C2:C11,SUM)PIVOTARPOR = PIVOTBY

In E1, build a table with branches as rows, quarters as columns and the sum of sales with PIVOTBY.

E1
ABCDEFGHIJ
1BranchQuarterSales
2DowntownQ142,000.00
3DowntownQ245,500.00
4DowntownQ339,800.00
5NorthQ131,200.00
6NorthQ235,800.00
7NorthQ338,900.00
8SouthQ127,400.00
9SouthQ229,900.00
10SouthQ333,100.00
11DowntownQ36,200.00
12

Tip: while typing, click a cell or drag across several to insert their reference. F4 anchors the reference with $.

Frequently asked questions

What is PIVOTBY called in Spanish?
In Spanish Excel it is PIVOTARPOR. The formula =PIVOTBY(A2:A11,B2:B11,C2:C11,SUM) is written =PIVOTARPOR(A2:A11;B2:B11;C2:C11;SUMA) (or with commas in Mexico).
Why does PIVOTBY use semicolons in some Excel versions?
It depends on regional settings. Where the comma is the decimal mark (Spain, much of South America), Excel separates arguments with semicolons. English Excel and Mexican Spanish Excel use commas.
What is the most common PIVOTBY mistake?
Excel 365 only. Unlike a PivotTable, there is no Refresh button to press: it changes as soon as the data does.