Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default Request for formula

A B C D E F ......... AA
Name Jan Feb Mar Apr May........
1 a 10 9 22 15 15
2 b 12 3 11 18 12
3 c 12 11 16 17 23
4 d 23 22 12 21 22

I am using office 2007,I will enter the figure every month into this
worksheet. what formula should I use to sum the latest 4 months of figure and
show it in column AA?

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Request for formula

Hi,

Try

=SUM(OFFSET(A2,,COUNT(A2:P2)-1,,-4))

Mike

"Eddie" wrote:

A B C D E F ......... AA
Name Jan Feb Mar Apr May........
1 a 10 9 22 15 15
2 b 12 3 11 18 12
3 c 12 11 16 17 23
4 d 23 22 12 21 22

I am using office 2007,I will enter the figure every month into this
worksheet. what formula should I use to sum the latest 4 months of figure and
show it in column AA?

Thank you

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default Request for formula


Is the negative width an undocumented feature of the offset formula?

I modified Mike's formula slightly:

=SUM(OFFSET(B2,,COUNT(B2:Z2)-4,,4))

Change Z to whatever is your rightmost month column.

Lars-Åke

On Sun, 1 Feb 2009 00:40:00 -0800, Mike H
wrote:

Hi,

Try

=SUM(OFFSET(A2,,COUNT(A2:P2)-1,,-4))

Mike

"Eddie" wrote:

A B C D E F ......... AA
Name Jan Feb Mar Apr May........
1 a 10 9 22 15 15
2 b 12 3 11 18 12
3 c 12 11 16 17 23
4 d 23 22 12 21 22

I am using office 2007,I will enter the figure every month into this
worksheet. what formula should I use to sum the latest 4 months of figure and
show it in column AA?

Thank you


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Request for formula

Hi,


What advantage do you see in the change you made to my formula?


Mike

"Lars-Ã…ke Aspelin" wrote:


Is the negative width an undocumented feature of the offset formula?

I modified Mike's formula slightly:

=SUM(OFFSET(B2,,COUNT(B2:Z2)-4,,4))

Change Z to whatever is your rightmost month column.

Lars-Ã…ke

On Sun, 1 Feb 2009 00:40:00 -0800, Mike H
wrote:

Hi,

Try

=SUM(OFFSET(A2,,COUNT(A2:P2)-1,,-4))

Mike

"Eddie" wrote:

A B C D E F ......... AA
Name Jan Feb Mar Apr May........
1 a 10 9 22 15 15
2 b 12 3 11 18 12
3 c 12 11 16 17 23
4 d 23 22 12 21 22

I am using office 2007,I will enter the figure every month into this
worksheet. what formula should I use to sum the latest 4 months of figure and
show it in column AA?

Thank you



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default Request for formula

bit long one

=SUM(INDIRECT("r"&ROW(2:2)&"c"&COUNT(A2:P2)-3&":r"&ROW(2:2)&"c"&COUNT
(A2:P2),0))

On Feb 1, 1:13*pm, Eddie wrote:
* * *A * * * * * B * * *C * * * D * * * E * * * F *......... *AA
* * *Name * *Jan * *Feb * Mar * *Apr * May........ *
1 * *a * * * * 10 * * 9 * * *22 * * * 15 * * *15
2 * *b * * * * 12 * * 3 * * *11 * * * 18 * * *12
3 * *c * * * * 12 * * 11 * * 16 * * * 17 * * 23
4 * *d * * * * 23 * * 22 * * 12 * * * 21 * * 22

I am using office 2007,I will enter the figure every month into this
worksheet. what formula should I use to sum the latest 4 months of figure and
show it in column AA?

Thank you




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default Request for formula

I read in the help for OFFSET function that width must be a positive
number, see
http://office.microsoft.com/en-us/ex...092081033.aspx
http://office.microsoft.com/en-us/ex...624151033.aspx
but sometimes there are some undocumented features that can be useful,
so that's why I asked you about the negative width.

After posting I found this page where it is stated that a negative
width could give problems in earlier versions of Excel, see
http://support.microsoft.com/kb/184109
So, the advantage is to avoid this (possible) problem.

The change from B2 to A2 is just to be able to handle possible numeric
names.

Lars-Åke

On Sun, 1 Feb 2009 01:14:00 -0800, Mike H
wrote:

Hi,


What advantage do you see in the change you made to my formula?


Mike

"Lars-Åke Aspelin" wrote:


Is the negative width an undocumented feature of the offset formula?

I modified Mike's formula slightly:

=SUM(OFFSET(B2,,COUNT(B2:Z2)-4,,4))

Change Z to whatever is your rightmost month column.

Lars-Åke

On Sun, 1 Feb 2009 00:40:00 -0800, Mike H
wrote:

Hi,

Try

=SUM(OFFSET(A2,,COUNT(A2:P2)-1,,-4))

Mike

"Eddie" wrote:

A B C D E F ......... AA
Name Jan Feb Mar Apr May........
1 a 10 9 22 15 15
2 b 12 3 11 18 12
3 c 12 11 16 17 23
4 d 23 22 12 21 22

I am using office 2007,I will enter the figure every month into this
worksheet. what formula should I use to sum the latest 4 months of figure and
show it in column AA?

Thank you




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Request for formula

Hi,

That's interesting that using negative width giving problems, I always used
it that way because I think it's quite intuative when you look at the formula
and I've never experienced problems. Thanks for the links.

Mike

"Lars-Ã…ke Aspelin" wrote:

I read in the help for OFFSET function that width must be a positive
number, see
http://office.microsoft.com/en-us/ex...092081033.aspx
http://office.microsoft.com/en-us/ex...624151033.aspx
but sometimes there are some undocumented features that can be useful,
so that's why I asked you about the negative width.

After posting I found this page where it is stated that a negative
width could give problems in earlier versions of Excel, see
http://support.microsoft.com/kb/184109
So, the advantage is to avoid this (possible) problem.

The change from B2 to A2 is just to be able to handle possible numeric
names.

Lars-Ã…ke

On Sun, 1 Feb 2009 01:14:00 -0800, Mike H
wrote:

Hi,


What advantage do you see in the change you made to my formula?


Mike

"Lars-Ã…ke Aspelin" wrote:


Is the negative width an undocumented feature of the offset formula?

I modified Mike's formula slightly:

=SUM(OFFSET(B2,,COUNT(B2:Z2)-4,,4))

Change Z to whatever is your rightmost month column.

Lars-Ã…ke

On Sun, 1 Feb 2009 00:40:00 -0800, Mike H
wrote:

Hi,

Try

=SUM(OFFSET(A2,,COUNT(A2:P2)-1,,-4))

Mike

"Eddie" wrote:

A B C D E F ......... AA
Name Jan Feb Mar Apr May........
1 a 10 9 22 15 15
2 b 12 3 11 18 12
3 c 12 11 16 17 23
4 d 23 22 12 21 22

I am using office 2007,I will enter the figure every month into this
worksheet. what formula should I use to sum the latest 4 months of figure and
show it in column AA?

Thank you




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Request for formula

Meant to add that because of this potential error I'll use it the way you
suggest in future.

Thanks again

"Mike H" wrote:

Hi,

That's interesting that using negative width giving problems, I always used
it that way because I think it's quite intuative when you look at the formula
and I've never experienced problems. Thanks for the links.

Mike

"Lars-Ã…ke Aspelin" wrote:

I read in the help for OFFSET function that width must be a positive
number, see
http://office.microsoft.com/en-us/ex...092081033.aspx
http://office.microsoft.com/en-us/ex...624151033.aspx
but sometimes there are some undocumented features that can be useful,
so that's why I asked you about the negative width.

After posting I found this page where it is stated that a negative
width could give problems in earlier versions of Excel, see
http://support.microsoft.com/kb/184109
So, the advantage is to avoid this (possible) problem.

The change from B2 to A2 is just to be able to handle possible numeric
names.

Lars-Ã…ke

On Sun, 1 Feb 2009 01:14:00 -0800, Mike H
wrote:

Hi,


What advantage do you see in the change you made to my formula?


Mike

"Lars-Ã…ke Aspelin" wrote:


Is the negative width an undocumented feature of the offset formula?

I modified Mike's formula slightly:

=SUM(OFFSET(B2,,COUNT(B2:Z2)-4,,4))

Change Z to whatever is your rightmost month column.

Lars-Ã…ke

On Sun, 1 Feb 2009 00:40:00 -0800, Mike H
wrote:

Hi,

Try

=SUM(OFFSET(A2,,COUNT(A2:P2)-1,,-4))

Mike

"Eddie" wrote:

A B C D E F ......... AA
Name Jan Feb Mar Apr May........
1 a 10 9 22 15 15
2 b 12 3 11 18 12
3 c 12 11 16 17 23
4 d 23 22 12 21 22

I am using office 2007,I will enter the figure every month into this
worksheet. what formula should I use to sum the latest 4 months of figure and
show it in column AA?

Thank you




  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 806
Default Request for formula

Hello Eddie,

I would not use any volatile function like INDIRECT or OFFSET but
(enter into AA2 and copy down):
=SUM(INDEX(B2:Z2,1,MAX(1,MATCH($AA$1,$B$1:$Z$1,1)-3)):INDEX
(B2:Z2,1,MATCH($AA$1,$B$1:$Z$1,1)))

You have to prepare your worksheet like this:
Enter into B1: 1/1/2009 and format the cell with the custom format
mmm. Then you would see "Jan". Do this for C1, D1, ... accordingly.

Then you can flexibly enter into AA1: 1/7/2009 to sum Apr, May, Jun,
Jul or enter 1/4/2009 to add Jan - Apr. If you enter 1/2/2009 it would
sum up only Jan - Feb it this formula would not fail - this might be
what you want if you don't have 4 subsequent months yet.

Regards,
Bernd
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Request for formula

Put this formula in AA2 and copy it down....

=SUMPRODUCT((COLUMN(B2:Z2)SUMPRODUCT(MAX((B2:Z2< "")*COLUMN(B2:Z2)))-4)*B2:Z2)

--
Rick (MVP - Excel)


"Eddie" wrote in message ...
A B C D E F ......... AA
Name Jan Feb Mar Apr May........
1 a 10 9 22 15 15
2 b 12 3 11 18 12
3 c 12 11 16 17 23
4 d 23 22 12 21 22

I am using office 2007,I will enter the figure every month into this
worksheet. what formula should I use to sum the latest 4 months of figure and
show it in column AA?

Thank you



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Request for formula

Hi Rick,

Just a quick question

why the -1? why not start at B2?

=SUM(OFFSET(A2,0,COUNT(B2:M2),,-4))


Cheers,
Shane Devenshire


"Mike H" wrote:

Hi,

Try

=SUM(OFFSET(A2,,COUNT(A2:P2)-1,,-4))

Mike

"Eddie" wrote:

A B C D E F ......... AA
Name Jan Feb Mar Apr May........
1 a 10 9 22 15 15
2 b 12 3 11 18 12
3 c 12 11 16 17 23
4 d 23 22 12 21 22

I am using office 2007,I will enter the figure every month into this
worksheet. what formula should I use to sum the latest 4 months of figure and
show it in column AA?

Thank you

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 request.... Shevvie Excel Discussion (Misc queries) 1 December 18th 07 03:48 PM
Formula request Serge Excel Discussion (Misc queries) 1 February 26th 07 12:40 AM
Formula request ~~~AAA~~~ Excel Worksheet Functions 1 September 14th 06 05:05 AM
Request a formula! IcoHolic Excel Worksheet Functions 3 August 21st 06 07:13 PM
formula request A. Toczko Excel Worksheet Functions 4 May 17th 05 02:34 AM


All times are GMT +1. The time now is 02:27 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"