I have this formula in spreadsheet that works as supposed. The formula is placed in "O:O" (this one is from O10). (I've translated the formula from danish - hope I did it right)
=IFERROR(IF(I10<>"";sum(INDIRECT("L"&MATCH(LEFT(B10;LEN(B10)-6);B:B;0)):INDIRECT("L"&ROW()-1));"");"Fejl/Mangler reference")
The data is imported from another sheet and the lines can change over time and there can be added/removed rows that should be taken into consideration in each Sub Total.
This is why I want to convert the formula to an arrayformula - or another solution?
What I thought would work was:
=Arrayformula(IF(ROW(R:R)=5;"Balance";IF(ROW(R:R)<7;"";IF(ROW(R:R)=7;"Sub Total";IF($I:$I<>"";sum(INDIRECT("L"&MATCH(LEFT(B:B;LEN(B:B)-6);B:B;0))&":"&INDIRECT("L"&ROW()-1));"")))))
I guess is the Indirect so I've tried also to do it with a vlookup but that I couldn't figure out either.
Any good ideas?
Here's a link for the document: Spreadsheet