Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default summing last values in column

1. I would like to sum the last 25 days values in a column
automatically once the data are input


example:


a. I want to add the sum of the last 25 values in column A
b. the cell that provides me the figure will be cell A1
c. as soon as the data are entered at the bottom of the worksheet, A1
updates automatically
d. some cells in column A are blank

- How do I keep a running total of the last 25, or any values?

Biff, I rewrote for better explanation.

Thanks in advance,
E

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,726
Default summing last values in column

=SUM(LARGE(A2:A20,ROW(INDIRECT("1:"&MIN(COUNT(A:A) ,25)))))

which is an array formula, so commit with Ctrl-Shift-Enter, not just Enter.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"gotta know" wrote in message
ps.com...
1. I would like to sum the last 25 days values in a column
automatically once the data are input


example:


a. I want to add the sum of the last 25 values in column A
b. the cell that provides me the figure will be cell A1
c. as soon as the data are entered at the bottom of the worksheet, A1
updates automatically
d. some cells in column A are blank

- How do I keep a running total of the last 25, or any values?

Biff, I rewrote for better explanation.

Thanks in advance,
E



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default summing last values in column

Try this *array* formula in A1:

=SUM(A1000:INDEX(A2:A1000,LARGE(ROW(A2:A1000)*(A2: A1000<""),26)))

--
Array formulas are entered using CSE, <Ctrl <Shift <Enter, instead of the
regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, CSE *must* be used when
revising the formula.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"gotta know" wrote in message
ps.com...
1. I would like to sum the last 25 days values in a column
automatically once the data are input


example:


a. I want to add the sum of the last 25 values in column A
b. the cell that provides me the figure will be cell A1
c. as soon as the data are entered at the bottom of the worksheet, A1
updates automatically
d. some cells in column A are blank

- How do I keep a running total of the last 25, or any values?

Biff, I rewrote for better explanation.

Thanks in advance,
E


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default summing last values in column

Hmm. I tried the above, but returns 0.

What I am looking to do...

A1 = (sum of last 25 values in column A)

cell value

a5 2
a6 4
....
a38 0
a39 2
a40 3
a41 0

(I would like to have A1 sum up the last 25 values as soon as the data
are input into column A)

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 620
Default summing last values in column

If you tried to put Bob's formula in column A, it should have warned you of
a circular reference (which you could cure by restricting the A:A range).
Try it in column B (and remember it needs C.S.E.).
--
David Biddulph

"gotta know" wrote in message
ups.com...
Hmm. I tried the above, but returns 0.

What I am looking to do...

A1 = (sum of last 25 values in column A)

cell value

a5 2
a6 4
...
a38 0
a39 2
a40 3
a41 0

(I would like to have A1 sum up the last 25 values as soon as the data
are input into column A)





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default summing last values in column


It does give me a circular reference...

However, when I move it to colum B, it gives me the whole sum of column
A, not the "trailing" 25 periods...

-E

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default summing last values in column

*EDIT...

Yes it does give me a circular reference. I moved to column B.

This forumula gives me the sum of values in A2:A20, not the last 25
periods in column A.

=SUM(LARGE(A2:A20,ROW(INDIRECT("1:"&MIN(COUNT(A:A) ,25)))))

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default summing last values in column

Anything wrong with my suggestion?
--

Regards,

RD
-----------------------------------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
-----------------------------------------------------------------------------------------------

"gotta know" wrote in message
ups.com...
*EDIT...

Yes it does give me a circular reference. I moved to column B.

This forumula gives me the sum of values in A2:A20, not the last 25
periods in column A.

=SUM(LARGE(A2:A20,ROW(INDIRECT("1:"&MIN(COUNT(A:A) ,25)))))


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default summing last values in column

RD:

Your formula below gave me: "#NUM!"

=SUM(LARGE(A2:A20,ROW(INDIRECT("1:"&MIN(COUNT(A:A) ,25)))))

The example below details what I need. Basically, if I have cells
A5:A5000 filled with data, and keep inputting data in A5001, A5002 on a
daily basis, I need the SUM of the trailing 25 periods.

A1 = sum of last 25 values

cell value
a501 1
a502 8
a503 0
....
a1001 0
a1002 0
a1003 6 ( I would need cell A1 to give me the sum of the last 25
periods sum(a978:a1003)



RagDyeR wrote:
Anything wrong with my suggestion?


  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default summing last values in column

RD,
this was ingenious.

Kostis

RagDyeR wrote:
Try this *array* formula in A1:

=SUM(A1000:INDEX(A2:A1000,LARGE(ROW(A2:A1000)*(A2: A1000<""),26)))

--
Array formulas are entered using CSE, <Ctrl <Shift <Enter, instead of the
regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, CSE *must* be used when
revising the formula.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"gotta know" wrote in message
ps.com...
1. I would like to sum the last 25 days values in a column
automatically once the data are input


example:


a. I want to add the sum of the last 25 values in column A
b. the cell that provides me the figure will be cell A1
c. as soon as the data are entered at the bottom of the worksheet, A1
updates automatically
d. some cells in column A are blank

- How do I keep a running total of the last 25, or any values?

Biff, I rewrote for better explanation.

Thanks in advance,
E




  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default summing last values in column

If you include the offset then you don't have "munge" the n: (which could be
really confusing if the range started in, say, A7)

=SUM(A100:INDEX(A2:A100,LARGE((A2:A100<"")*(ROW(A 2:A100)-ROW(A2)+1),25)))

Another way that excludes both empty cells and 0 values:

=SUM(A100:INDEX(A2:A100,LARGE(IF(A2:A100,ROW(A2:A1 00)-ROW(A2)+1),25)))

Biff

"RagDyeR" wrote in message
...
Try this *array* formula in A1:

=SUM(A1000:INDEX(A2:A1000,LARGE(ROW(A2:A1000)*(A2: A1000<""),26)))

--
Array formulas are entered using CSE, <Ctrl <Shift <Enter, instead of
the
regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, CSE *must* be used when
revising the formula.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"gotta know" wrote in message
ps.com...
1. I would like to sum the last 25 days values in a column
automatically once the data are input


example:


a. I want to add the sum of the last 25 values in column A
b. the cell that provides me the figure will be cell A1
c. as soon as the data are entered at the bottom of the worksheet, A1
updates automatically
d. some cells in column A are blank

- How do I keep a running total of the last 25, or any values?

Biff, I rewrote for better explanation.

Thanks in advance,
E




  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default summing last values in column

You're right Biff, the number of cells to calculate would be more obvious.

And I assume that you're using the convoluted offset of
"(ROW(A2:A100)-ROW(A2)+1)",
instead of just "(ROW(A2:A100)-1)" because of the possibility of row inserts
and deletes.

I guess it's a matter of preference, since to cover *all* possibilities can
be very difficult.

Delete Row2 and see what happens to your formula.

Insert at Row2 and see what happens to mine.

Both have shortcomings!
--

Regards,

RD
-----------------------------------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
-----------------------------------------------------------------------------------------------



"T. Valko" wrote in message
...
If you include the offset then you don't have "munge" the n: (which could be
really confusing if the range started in, say, A7)

=SUM(A100:INDEX(A2:A100,LARGE((A2:A100<"")*(ROW(A 2:A100)-ROW(A2)+1),25)))

Another way that excludes both empty cells and 0 values:

=SUM(A100:INDEX(A2:A100,LARGE(IF(A2:A100,ROW(A2:A1 00)-ROW(A2)+1),25)))

Biff

"RagDyeR" wrote in message
...
Try this *array* formula in A1:

=SUM(A1000:INDEX(A2:A1000,LARGE(ROW(A2:A1000)*(A2: A1000<""),26)))

--
Array formulas are entered using CSE, <Ctrl <Shift <Enter, instead of
the
regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, CSE *must* be used when
revising the formula.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"gotta know" wrote in message
ps.com...
1. I would like to sum the last 25 days values in a column
automatically once the data are input


example:


a. I want to add the sum of the last 25 values in column A
b. the cell that provides me the figure will be cell A1
c. as soon as the data are entered at the bottom of the worksheet, A1
updates automatically
d. some cells in column A are blank

- How do I keep a running total of the last 25, or any values?

Biff, I rewrote for better explanation.

Thanks in advance,
E





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
summing values in a data table based on criteria in another column Dave F Excel Worksheet Functions 7 August 26th 06 04:36 PM
How to match values in one column to values in another? trib Excel Worksheet Functions 3 July 25th 06 08:30 AM
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
summing values from adjacent column with refrence from adjacent column Pivotrend Excel Discussion (Misc queries) 6 March 4th 06 11:24 AM
Lookup values in one column to return another [email protected] Excel Worksheet Functions 4 November 17th 05 09:42 PM


All times are GMT +1. The time now is 10:47 PM.

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

About Us

"It's about Microsoft Excel"