Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tzvarza`
 
Posts: n/a
Default sum of last 7 numbers


I have a row where I enter a number every day. I need a cell which shows
the sum of the last 7 entered numbers.

For example, if I have the numbers 7 2 4 11 5 4 2 6, the cell must show
28 (11+5+4+2+6)


--
tzvarza`
------------------------------------------------------------------------
tzvarza`'s Profile: http://www.excelforum.com/member.php...o&userid=28765
View this thread: http://www.excelforum.com/showthread...hreadid=484523

  #2   Report Post  
bpeltzer
 
Posts: n/a
Default sum of last 7 numbers

If your data is in row 2, starting in column A, then the formula =sum(a2:g2),
entered in g3 will give you the total of the first seven days. You can
autofill this formula to the right, and each day will have the sum of the
seven days ending with the latest.
Be aware that you run out of columns in Excel way before you run out of
rows. If this is a long-term project, you may want to restructure your data
so that each day's info is in the next row (rather than in the next column).

"tzvarza`" wrote:


I have a row where I enter a number every day. I need a cell which shows
the sum of the last 7 entered numbers.

For example, if I have the numbers 7 2 4 11 5 4 2 6, the cell must show
28 (11+5+4+2+6)


--
tzvarza`
------------------------------------------------------------------------
tzvarza`'s Profile: http://www.excelforum.com/member.php...o&userid=28765
View this thread: http://www.excelforum.com/showthread...hreadid=484523


  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default sum of last 7 numbers

On Sat, 12 Nov 2005 07:39:33 -0600, tzvarza`
wrote:


I have a row where I enter a number every day. I need a cell which shows
the sum of the last 7 entered numbers.

For example, if I have the numbers 7 2 4 11 5 4 2 6, the cell must show
28 (11+5+4+2+6)



Not sure exactly what you want. In your text, you want the sum of the last 7;
but in your example, you are only summing the last 5.

Assumptions:
1. SUM formula is in cell A2
2. Data is in B2:IV2
3. Data is entered consecutively with no intervening blanks that need to be
ignored.
4. nums = the number of most recent entries to be SUM'd (5 or 7 or whatever)

The **array entered** formula:

=IF(COUNT(B2:IV2)<=nums,SUM(B2:IV2),SUM(OFFSET(A2, 0,-1+MAX(ISNUMBER(B2:IV2)*COLUMN(B2:IV2)),1,-nums)))

To **array-enter** a formula, after typing/pasting it into the formula bar,
hold down <ctrl<shift while hitting <enter. Excel will place braces {...}
around the formula.




--ron
  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default sum of last 7 numbers

=SUM(LARGE((COLUMN(1:1))*(1:1<""),{1,2,3,4,5,6,7} ))

as an array formula, so commit with Ctrl-Shift-Enter

--

HTH

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


"tzvarza`" wrote in
message ...

I have a row where I enter a number every day. I need a cell which shows
the sum of the last 7 entered numbers.

For example, if I have the numbers 7 2 4 11 5 4 2 6, the cell must show
28 (11+5+4+2+6)


--
tzvarza`
------------------------------------------------------------------------
tzvarza`'s Profile:

http://www.excelforum.com/member.php...o&userid=28765
View this thread: http://www.excelforum.com/showthread...hreadid=484523



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
formulas to numbers Steve New Users to Excel 2 September 16th 05 12:07 AM
Checking Winning Numbers in the Lottery. Ann Excel Discussion (Misc queries) 4 May 18th 05 10:55 AM
Match Last Occurrence of two numbers and Return Date Sam via OfficeKB.com Excel Worksheet Functions 6 April 5th 05 12:40 PM
Match Last Occurrence of two numbers and Count to Previous Occurence Sam via OfficeKB.com Excel Worksheet Functions 33 April 4th 05 02:17 PM
Count and Sum Total occurrances of two specific numbers Sam via OfficeKB.com Excel Worksheet Functions 10 March 29th 05 08:13 PM


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