Return 5 latest entries for specific column

xlDude

New Member
Joined
Dec 21, 2012
Messages
7
I'm working on a project with tables. I'm not sure if I can use a function or I have to vba. I want to retrieve the lastest 5 entries for a specific column (column AA), but not blank ones. Then I want to retrieve latest 5 entries for column AC. On a seperate sheet I want the entries to be seen in order and I want it to change as new data is entered into the table. In the end I'll have the latest 5 entries for Internal (Column AA) and then after that the latest 5 entreis for External (Column AC).

latest5.jpg
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi,

Here is an example set-up that you can adjust to suit your table. These are array formulae so you will need to press CTRL-SHIFT-ENTER rather than just ENTER before dragging down:

The table:

Sheet1[TABLE="class: html-maker-worksheet"]
<tbody>[TR]
[TH][/TH]
[TH]AA[/TH]
[TH]AC[/TH]
[/TR]
[TR]
[TH]1[/TH]
[TD]Internal[/TD]
[TD]External[/TD]
[/TR]
[TR]
[TH]2[/TH]
[TD]a[/TD]
[TD]g[/TD]
[/TR]
[TR]
[TH]3[/TH]
[TD][/TD]
[TD]h[/TD]
[/TR]
[TR]
[TH]4[/TH]
[TD][/TD]
[TD]i[/TD]
[/TR]
[TR]
[TH]5[/TH]
[TD]b[/TD]
[TD][/TD]
[/TR]
[TR]
[TH]6[/TH]
[TD]c[/TD]
[TD][/TD]
[/TR]
[TR]
[TH]7[/TH]
[TD]d[/TD]
[TD]j[/TD]
[/TR]
[TR]
[TH]8[/TH]
[TD][/TD]
[TD]k[/TD]
[/TR]
[TR]
[TH]9[/TH]
[TD]e[/TD]
[TD]l[/TD]
[/TR]
[TR]
[TH]10[/TH]
[TD]f[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Excel 2010

The output of the 5 latest:

Sheet2[TABLE="class: html-maker-worksheet"]
<tbody>[TR]
[TH][/TH]
[TH]A[/TH]
[TH]B[/TH]
[/TR]
[TR]
[TH]1[/TH]
[TD]Internal[/TD]
[TD]External[/TD]
[/TR]
[TR]
[TH]2[/TH]
[TD]b[/TD]
[TD]h[/TD]
[/TR]
[TR]
[TH]3[/TH]
[TD]c[/TD]
[TD]i[/TD]
[/TR]
[TR]
[TH]4[/TH]
[TD]d[/TD]
[TD]j[/TD]
[/TR]
[TR]
[TH]5[/TH]
[TD]e[/TD]
[TD]k[/TD]
[/TR]
[TR]
[TH]6[/TH]
[TD]f[/TD]
[TD]l[/TD]
[/TR]
</tbody>[/TABLE]
Excel 2010

CellFormula
A2=INDEX(Table1[Internal],
LARGE(
IF(Table1[Internal]<>"",ROW(Table1[Internal])-ROW(INDEX(Table1[Internal],1))+1),
6-ROWS(A$1:A1)
)
)
B2=INDEX(Table1[External],
LARGE(
IF(Table1[External]<>"",ROW(Table1[External])-ROW(INDEX(Table1[External],1))+1),
6-ROWS(B$1:B1)
)
)

<tbody>
[TD="bgcolor: #FFFFFF"] Array Formulas [TABLE="class: html-maker-worksheet"]
<tbody>[TR]

</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}. Note: Do not try and enter these manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
Note also:

 
Upvote 0

Forum statistics

Threads
1,226,730
Messages
6,192,702
Members
453,748
Latest member
akhtarf3

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