Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default 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?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default 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?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default 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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
why do some cells automatically switch to ####### when I write? Curious New Users to Excel 6 January 16th 09 07:23 PM
Automatically insert time in excel but not automatically updated NeueN Excel Worksheet Functions 4 December 25th 08 07:29 AM
how do I write an IF/other statement to cut off time data? Daren Excel Worksheet Functions 15 November 2nd 06 11:49 PM
how do I write a vlookup function within an iserror function so t. JBLeeds Excel Worksheet Functions 2 March 16th 05 10:30 AM
How do I write my formula to automatically regenerate a RAND () i. Regi Excel Worksheet Functions 1 December 8th 04 10:06 PM


All times are GMT +1. The time now is 09:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"