'how i can apply the ARRAYFORMULA function on the " =SOMME(....)"

image

how i can apply the ARRAYFORMULA function on the function

=SOMME(filter($A$2:B;$A$2:A=INDIRECT("E"&LIGNE()))

I want to get the same result of column F in column G



Solution 1:[1]

Delete your formulas from Col E, Col F and Col G.

Then place the following formula in, say, cell E2:

=ArrayFormula(QUERY({A2:B};"Select Col1, SUM(Col2) WHERE Col1 Is Not Null GROUP BY Col1 LABEL SUM(Col2) '' "))

This version would produce the same result...

=ArrayFormula(QUERY(A2:B;"Select A, SUM(B) WHERE A Is Not Null GROUP BY A LABEL SUM(B) '' "))

... but I always recommend using the first version, just incase data in the target columns ever moves (e.g., if you were to insert a column before Col A, making the old A and B become B and C, the second formula would break while the first would not).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1