The PIVOTBY
The PIVOTBY function in Office 365 Excel is a powerful tool that allows you to create summary reports similar to PivotTables but using formulas instead. Here’s a brief overview of how it works and its syntax:
PIVOTBY(row_fields, col_fields, values, function, [field_headers], [row_total_depth], [row_sort_order], [col_total_depth], [col_sort_order], [filter_array], [relative_to])
Arguments:
Example:
Let’s say you have a dataset with Category, Year, and Sales columns, and you want to summarize sales by category and year:
The formula would look like this:
=PIVOTBY(A2:A10, B2:B10, C2:C10, LAMBDA(x, SUM(x)))
This formula groups the data by Category and Year, and sums the Sales for each group.
Benefits of PIVOTBY: