Sum the last 10 entries in a dynamic range

rozak

New Member
Joined
Nov 24, 2016
Messages
8
Syntax: Find the last entry in col C, then sum that plus the 9 entries above it.

=SUM(LOOKUP(2,1/(C:C<>""),C:C):OFFSET(LOOKUP(2,1/(C:C<>""),C:C),-9,,,))

Separately, the LOOKUP function works fine, but returns an error when used with OFFSET (in this case anyway).
Thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi.

The last 5 rows only !!!
Excel Workbook
CDE
11*500
21**
31**
41**
51**
61**
71**
8100**
9100**
10100**
11100**
12100**
13***
Sheet
 
Last edited:
Upvote 0
The simplest formula, IMO, is below. It assumes the data are in column M starting with M1.

Code:
=SUM(OFFSET(M1,COUNT(M:M)-1-(10-1),0,10))
An alternative, if one prefers INDEX to OFFSET is
Code:
=SUM(INDEX(M:M,COUNT(M:M)-(10-1)):INDEX(M:M,COUNT(M:M)))
The 2 references to 10 are to the number of elements you want to include in the SUM.
Syntax: Find the last entry in col C, then sum that plus the 9 entries above it.

=SUM(LOOKUP(2,1/(C:C<>""),C:C):OFFSET(LOOKUP(2,1/(C:C<>""),C:C),-9,,,))

Separately, the LOOKUP function works fine, but returns an error when used with OFFSET (in this case anyway).
Thanks
 
Upvote 0
Here's another one.

Assumes there will always be at least 10 numbers to sum and the data is in a contiguous range.

=SUM(OFFSET(C1,MATCH(1E100,C:C)-1,0,-10))
 
Upvote 0

Forum statistics

Threads
1,214,414
Messages
6,119,375
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top