Last five entries

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,540
Office Version
  1. 365
Platform
  1. Windows
hi,

hopefully someone can help me out here, im a little stuck for a formula?

i have a range K28:K97 with numbers in each cell, now starts at row 28, but every week or so a new number is added upto a maximum of 97 (sometimes not that many)

what i would like is a formula to show only the last 5 entries

hope someone can help me out here

thanks in advance
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
To return the last five numerical values from K28:K97 in a range of cells, let's say B2:B6, try...

B2, copied down:

=INDEX($K$28:$K$97,MATCH(9.99999999999999E+307,$K$28:$K$97)-ROWS($B$2:B2)+1)

Or, in reverse order...

B2, copied down:

=INDEX($K$28:$K$97,MATCH(9.99999999999999E+307,$K$28:$K$97)-5+ROWS($B$2:B2))
 
Upvote 0
great, thanks

was thinking along the lines of

"23, 34, 72, 22, 31"

all in one line?

is this achievable?
 
Upvote 0
Do you mean in separate cells? If so, try...

B2, copied across:

=INDEX($K$28:$K$97,MATCH(9.99999999999999E+307,$K$28:$K$97)-COLUMNS($B2:B2)+1)

or

=INDEX($K$28:$K$97,MATCH(9.99999999999999E+307,$K$28:$K$97)-5+COLUMNS($B2:B2))
 
Upvote 0
A1:

=MIN(5,COUNT($K$28:$K$97))

A2:

=MATCH(9.99999999999999E+307,$K$28:$K$97)

A3: List

A4, copied down:

=IF(ROWS($B$7:B7)<=$A$1,INDEX($K$28:$K$97,$A$2-$A$1+ROWS($B$7:B7)),"")
 
Upvote 0
Try...

=INDEX($K$28:$K$97,MATCH(9.99999999999999E+307,$K$28:$K$97))&", "&INDEX($K$28:$K$97,MATCH(9.99999999999999E+307,$K$28:$K$97)-1)&", "&INDEX($K$28:$K$97,MATCH(9.99999999999999E+307,$K$28:$K$97)-2)&", "&INDEX($K$28:$K$97,MATCH(9.99999999999999E+307,$K$28:$K$97)-3)&", "&INDEX($K$28:$K$97,MATCH(9.99999999999999E+307,$K$28:$K$97)-4)

Or, you can reverse the order, if you prefer. Also, if you define (Formulas > Defined Names > Define Names) BigNum as 9.99999999999999E+307, you can replace that big number in the formula with BigNum.
 
Upvote 0
Thanks Aladin for the reply, but i will use Domenic's solution, much easier in one cell

Perfect! thanks

One problem tho, if there is only one entry, it throws up an error

would it be possible to show only the one entry until more is entered
 
Last edited:
Upvote 0
One problem tho, if there is only one entry, it throws up an error

would it be possible to show only the one entry until more is entered

In that case, I would strongly suggest that you use Aladin's solution. Also, it makes it easier to work with if, for example, you want to sum, average, etc.
 
Upvote 0
Hi,

Aladins solution only shows in different cells, not all in one cell, which is what im after
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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