FormulaCamp
Completed
← All functions
Dynamic arrays

PIVOTBY

Cross-tab in one formula: rows × columns. In the trainer, one row field and one column field.

Syntax

PIVOTBY(row_fields, col_fields, values, function, …)

Example: =PIVOTBY(A2:A20,B2:B20,C2:C20,SUM)

Available in: Microsoft 365 only

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =PIVOTBY(A2:A7,B2:B7,C2:C7,SUM)

Example spreadsheet for PIVOTBY
ABCDEFGHIJ
1RegionProductUnitsPriceResult
2EastPen1202.5BookLampPenTotal
3WestPen802.5East4515120180
4EastBook4512North6060
5NorthBook6012West3080110
6WestLamp3025Total10545200350
7EastLamp1525
Result in F2:
Practice this in a lesson: GROUPBY and PIVOTBY

More in Dynamic arrays