Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ellen
 
Posts: n/a
Default how to adjust formula dependent on current month

Would like to create a formula that will adjust dependent on the current
month. We are trying to get an average through the current month and do not
want to have to change the formula each month to include the latest month.

Thanks. - Ellen







  #2   Report Post  
Paul
 
Posts: n/a
Default

You could use an the offset command. This command allows you to offset
(shift) the references in your formula. You will need a cell to tell Offset
how far over to go

Another idea is that if the numbers are blank until you have data, I think
excel will ignore them for average purposes

"Ellen" wrote:

Would like to create a formula that will adjust dependent on the current
month. We are trying to get an average through the current month and do not
want to have to change the formula each month to include the latest month.

Thanks. - Ellen







  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

Say you had data in A2:B99 (headers in row 1). Dates in column A and quantities
in column B.

You could use this to average just the current month:

=average(if(text(a2:a99,"yyyymm")=text(today(),"yy yymm"),b2:b99))
This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

So you could use this kind of thing to get any dates through the current month:
=average(if(text(a2:a99,"yyyymm")<=text(today(),"y yyymm"),b2:b99))
(still an array formula)

If A2:A99 can contain empty cells...
=AVERAGE(IF((A2:A99<"")*(TEXT(A2:A99,"yyyymm")<=T EXT(TODAY(),"yyyymm")),
B2:B99))
(one cell, still an array formula)




Ellen wrote:

Would like to create a formula that will adjust dependent on the current
month. We are trying to get an average through the current month and do not
want to have to change the formula each month to include the latest month.

Thanks. - Ellen


--

Dave Peterson
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
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
Formula help. Different result dependent on answer martinco Excel Worksheet Functions 3 April 16th 05 04:40 PM
UserForm to select current month or earlier Steve Excel Discussion (Misc queries) 2 January 21st 05 09:41 PM
is there a formula to generate a calendar month date rather than . lmurray Excel Worksheet Functions 1 January 21st 05 03:24 PM
looking for a formula Amanda Excel Worksheet Functions 5 January 5th 05 07:37 AM


All times are GMT +1. The time now is 04:38 PM.

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"