Variable in array formula

PaulS

Board Regular
Joined
Feb 26, 2006
Messages
66
To the experts,
I have a formula that works fine but from time to time I have to change the formula because of the number of rows (transactions) has changed.
The formula:
=SUM(IF(MONTH($B$12:$B$99)=ROW($A1);M$12:M$99;0))
sums the amounts in col M when the months in col B equals to 1. The same formula is in other cells for the other months.
The cells with the formula is 20 rows under the last transaction row. This means that the cell with ther formula also moves down when more trancations are added.
The number of transactions will grow over the year. In the worksheet cell AL10 has the row number of the last transaction.(in this formula 99).
I am looking for a solution to replace 99 in the formula into the contents of cell AL10.
Thanks,
Paul
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
This formula is in my worksheet in cell M120
Because of the copy the brackets were removed, but the formula as shown is between { }.
Cell M121 contains the same formula but with "ROW($A2)" .
Hope this answers your question.
Paul
 
Upvote 0
This formula is in my worksheet in cell M120
Because of the copy the brackets were removed, but the formula as shown is between { }.
Cell M121 contains the same formula but with "ROW($A2)" .
Hope this answers your question.
Paul

I assume that all data belongs to the same year...

Control+shift+enter, not just enter, and copy down:

Code:
=SUM(IF(MONTH($B$12:INDEX($B:$B,$AL$10))=ROWS($M$120:M120);
    $M$12:INDEX($M:$M,$AL$10)))
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top