SOLVED

SUM between empty cells

Copper Contributor

Hello,
I would like to ask for advice. I have the data in the column, see picture. How to automatically sum data that is between empty cells? i.e.  SUMA(A1:A2); SUMA(A6:A9) .....

 

Thank you

 

Excel.png

6 Replies

@tomaspetBasked on what I see in the picture, you could just use =SUMA(A1:A23)

@Riny_van_Eekelen I couldn't do that. I need to get this (red numbers), but I need to fill in automatically because there are many rows in the table.

Excel_1.png

best response confirmed by tomaspet (Copper Contributor)
Solution

@tomaspet If you ae on and Excel version that support XMATCH, have a look at the attached file, using the following formula:

=IF(AND(ISBLANK(A1),NOT(ISBLANK(A2))),SUM(A2:INDEX(A2:$A$46,XMATCH(,A2:$A$46,0))),"")

Screenshot 2021-12-18 at 08.18.56.png

@Riny_van_Eekelen This is exactly what I would need, but my Excel doesnt support the XMATCH function. Is there no other way?

@tomaspet 

As variant

= SUM( INDEX( A:A, ROW() ):INDEX( A:A,  AGGREGATE(15, 6, 1/( INDEX( A:A, ROW() ):$A$46 = "") * ROW( A:A ),1 ) + ROW() - 2 ) )

@Riny_van_Eekelen I tried it in Excel online and everything works. Thank you.

1 best response

Accepted Solutions
best response confirmed by tomaspet (Copper Contributor)
Solution

@tomaspet If you ae on and Excel version that support XMATCH, have a look at the attached file, using the following formula:

=IF(AND(ISBLANK(A1),NOT(ISBLANK(A2))),SUM(A2:INDEX(A2:$A$46,XMATCH(,A2:$A$46,0))),"")

Screenshot 2021-12-18 at 08.18.56.png

View solution in original post