0 | A | B | C | D | E | F | G |
---|---|---|---|---|---|---|---|
1 | product | 2024-01 | 2024-02 | 2024-03 | 2024-04 | product_c | |
2 | product_a | 100 | 200 | 500 | 910 | 2024-03 | |
3 | product_a | 350 | 890 | 260 | 750 | ||
4 | product_b | 240 | 300 | 710 | 810 | 1602 | |
5 | product_c | 900 | 800 | 620 | 370 | ||
6 | product_c | 300 | 750 | 835 | 255 | ||
7 | product_c | 290 | 340 | 147 | 647 |
0 | A | B | C | D | E | F | G |
---|---|---|---|---|---|---|---|
1 | product | 2024-01 | 2024-02 | 2024-03 | 2024-04 | product_c | |
2 | product_a | 100 | 200 | 500 | 910 | 2024-03 | |
3 | product_a | 350 | 890 | 260 | 750 | ||
4 | product_b | 240 | 300 | 710 | 810 | 1602 | |
5 | product_c | 900 | 800 | 620 | 370 | ||
6 | product_c | 300 | 750 | 835 | 255 | ||
7 | product_c | 290 | 340 | 147 | 647 |
In Cell G4
I make a SUMIF
based on the column criteria in Cell G1
and the row criteria in Cell G2
using this formula:
=SUMIF($A$1:$A$7,$G$1,INDEX($A$1:$E$1,MATCH($G$2,$A$1:$E$1,0)))
All this works fine.
However, in my original file I have the issue now that the dataset is much larger compared to this example.
In the example the columns only go until 2024-04
.
In my original file I have
(a) much more years on a monthly basis and
(b) much more products and therefore much more rows.
This leads to the situation that the loading time when using the formula significantly increases.
Do you know if there is any alternative approach/formula which has the same functionality but does not effect the loading times as much?
Share Improve this question asked Apr 2 at 7:44 MichiMichi 5,5658 gold badges57 silver badges119 bronze badges 2 |1 Answer
Reset to default 0=SUMPRODUCT((A2:A7=G1)\*(B1:E1=G2)\*B2:E7)
SUMPRODUCT
processes arrays efficiently without needing multiple lookup functions.Works well if the dataset is structured properly.
=SUM(($B$2:$E$7)*($B$1:$E$1=$G$2)*($A$2:$A$7=$G$1))
, but I can't tell if it's faster or not. How big is your actual data set that you're getting slow responses? – Excellor Commented Apr 2 at 7:56loading time
? The sheet opening or the execution? – Black cat Commented Apr 2 at 8:48