ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   can I write a function that automatically changes over time (https://www.excelbanter.com/excel-worksheet-functions/230329-can-i-write-function-automatically-changes-over-time.html)

andyp

can I write a function that automatically changes over time
 
I would like to create a function that changes every month. For example in
month 1 the formula would be SUM(A1:A1), in month 2 it would be SUM(A1:A2),
in month 3 SUM(A1:A3), etc...

there is data in all cells starting at the first month, so I cannot just sum
the column.

Any suggestions?

Gary''s Student

can I write a function that automatically changes over time
 
Something like:

=SUM(INDIRECT("A1:A"&MONTH(TODAY())))

will provide the monthly adjustment on the range of the sum.
--
Gary''s Student - gsnu200852


"andyp" wrote:

I would like to create a function that changes every month. For example in
month 1 the formula would be SUM(A1:A1), in month 2 it would be SUM(A1:A2),
in month 3 SUM(A1:A3), etc...

there is data in all cells starting at the first month, so I cannot just sum
the column.

Any suggestions?


Jacob Skaria

can I write a function that automatically changes over time
 
Another one

=SUM(A1:OFFSET(A1,MONTH(TODAY())-1,0))

The above will give a sum of A1:A5 and will keep on changing wrt month.

If this post helps click Yes
---------------
Jacob Skaria


"andyp" wrote:

I would like to create a function that changes every month. For example in
month 1 the formula would be SUM(A1:A1), in month 2 it would be SUM(A1:A2),
in month 3 SUM(A1:A3), etc...

there is data in all cells starting at the first month, so I cannot just sum
the column.

Any suggestions?


Teethless mama

can I write a function that automatically changes over time
 
=SUM(A1:INDEX(A:A,MONTH(TODAY())))


"andyp" wrote:

I would like to create a function that changes every month. For example in
month 1 the formula would be SUM(A1:A1), in month 2 it would be SUM(A1:A2),
in month 3 SUM(A1:A3), etc...

there is data in all cells starting at the first month, so I cannot just sum
the column.

Any suggestions?



All times are GMT +1. The time now is 05:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com