Is it possible to use functions like Scan, Reduce, Lambda etc in calculated fields in excel pivot table?
For example, consider the table below. I would like to have a running total as a calculated field. I can use Scan function outside pivot table to get the running totals. Tried using it in calculated field, but not getting any result.
Base table:
Pivot table:
For example, consider the table below. I would like to have a running total as a calculated field. I can use Scan function outside pivot table to get the running totals. Tried using it in calculated field, but not getting any result.
Base table:
Book1 | ||||
---|---|---|---|---|
C | D | |||
2 | Date | Amount | ||
3 | 2-may-21 | 20 | ||
4 | 15-jul-21 | 5 | ||
5 | 2-mar-22 | 30 | ||
6 | 29-abr-23 | 7 | ||
7 | 8-sep-23 | 50 | ||
8 | 30-sep-23 | 11 | ||
9 | 17-nov-23 | 43 | ||
10 | 3-ene-24 | 23 | ||
11 | 28-feb-24 | 12 | ||
Sheet1 |
Pivot table:
Book1 | |||||
---|---|---|---|---|---|
F | G | H | |||
2 | Year | Sum of Amount | |||
3 | 2021 | 25 | 25 | ||
4 | 2022 | 30 | 55 | ||
5 | 2023 | 111 | 166 | ||
6 | 2024 | 35 | 201 | ||
7 | Grand Total | 201 | |||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
H3:H6 | H3 | =SCAN(0,G3:G6,LAMBDA(a,b,a+b)) |
Dynamic array formulas. |