Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nacho
 
Posts: n/a
Default Sum only last X cells

I have a worksheet where I add every week a column with numbers. I insert a
new column for the new week and the next cell has a formula that sums only
the last four cells.

The thing is that when I insert the column, the sums stays refering to the
previous 4 and does not consider the new one. I need this sum to consider
ONLY the last 4 coulmns to te left of that, any ideas? Can you refer
dynamicaly to the previous 4 cells in order to sum them??

Thanks in advance,
Rds, from Argentina
Ignacio
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Ignacio,

This works for row 1, assuming that the data starts in A1

=SUM(OFFSET(A1,,COUNTA(1:1)-4,,4))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Nacho" wrote in message
...
I have a worksheet where I add every week a column with numbers. I insert

a
new column for the new week and the next cell has a formula that sums only
the last four cells.

The thing is that when I insert the column, the sums stays refering to the
previous 4 and does not consider the new one. I need this sum to consider
ONLY the last 4 coulmns to te left of that, any ideas? Can you refer
dynamicaly to the previous 4 cells in order to sum them??

Thanks in advance,
Rds, from Argentina
Ignacio



  #3   Report Post  
Nacho
 
Posts: n/a
Default

Let me give an example:

I have the total in the right,

A B C D E
1 8 1 5 15

So when i add a column between E and D, i want the sum to be from B to E

Clearer now?

Rds, and many thanks
Ignacio

"Bob Phillips" wrote:

Hi Ignacio,

This works for row 1, assuming that the data starts in A1

=SUM(OFFSET(A1,,COUNTA(1:1)-4,,4))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Nacho" wrote in message
...
I have a worksheet where I add every week a column with numbers. I insert

a
new column for the new week and the next cell has a formula that sums only
the last four cells.

The thing is that when I insert the column, the sums stays refering to the
previous 4 and does not consider the new one. I need this sum to consider
ONLY the last 4 coulmns to te left of that, any ideas? Can you refer
dynamicaly to the previous 4 cells in order to sum them??

Thanks in advance,
Rds, from Argentina
Ignacio




  #4   Report Post  
LanceB
 
Posts: n/a
Default

where e1 is the location of this formula
=SUM(OFFSET(E1,0,-4,1,4))

"Nacho" wrote:

I have a worksheet where I add every week a column with numbers. I insert a
new column for the new week and the next cell has a formula that sums only
the last four cells.

The thing is that when I insert the column, the sums stays refering to the
previous 4 and does not consider the new one. I need this sum to consider
ONLY the last 4 coulmns to te left of that, any ideas? Can you refer
dynamicaly to the previous 4 cells in order to sum them??

Thanks in advance,
Rds, from Argentina
Ignacio

  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

That is nothing like what you originally asked.

=SUM(OFFSET(A1,,COUNT(A1:OFFSET(E1,,-1))-4,,4))

"Nacho" wrote in message
...
Let me give an example:

I have the total in the right,

A B C D E
1 8 1 5 15

So when i add a column between E and D, i want the sum to be from B to E

Clearer now?

Rds, and many thanks
Ignacio

"Bob Phillips" wrote:

Hi Ignacio,

This works for row 1, assuming that the data starts in A1

=SUM(OFFSET(A1,,COUNTA(1:1)-4,,4))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Nacho" wrote in message
...
I have a worksheet where I add every week a column with numbers. I

insert
a
new column for the new week and the next cell has a formula that sums

only
the last four cells.

The thing is that when I insert the column, the sums stays refering to

the
previous 4 and does not consider the new one. I need this sum to

consider
ONLY the last 4 coulmns to te left of that, any ideas? Can you refer
dynamicaly to the previous 4 cells in order to sum them??

Thanks in advance,
Rds, from Argentina
Ignacio






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
Help adding text values Texas-DC_271 Excel Worksheet Functions 7 January 15th 05 11:14 PM
Convert data type of cells to Text,Number,Date and Time Kevin Excel Worksheet Functions 1 December 31st 04 12:57 PM
To safety merge cells without data destroyed, and smart unmerge! Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:17 AM
Heps to design Locked/Unlocked cells in protected worksheet Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:09 AM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM


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