Copy Last 10 Cells from A Table and Paste into Another Table.

itsgrady

Board Regular
Joined
Sep 11, 2022
Messages
132
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
Table 1 - PortsPounds
Table 2 - 10DaysPounds

I need to copy the last 10 rows of table 1, column a to the table 2 Column

Table holds all of the date on a large table. I add data to this table about 3 times a week.

Table two 2 should hold the last 10 days (not consecutive days) of information people would like to see and use. If I can get the 10 days in the Table in column A I will use Xlookup up to get the remaining data.

I tried this but I could not get it to work:
=INDEX(PortsPound!A:A,COUNTA(PortsPound!A:A)-9):INDEX(PortsPound!A:A,COUNTA(PortsPound!A:A))
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
One way (of many):

=INDEX(PortsPound!A:A,AGGREGATE(14,6,ROW(PortsPound!A1:A100)/(PortsPound!A1:A100<>""),11-SEQUENCE(10)))
 
Upvote 0
Solution
How about:

Excel Formula:
=INDEX(A1:A100,SEQUENCE(10,,INDEX(A1:A100,ROWS(A1:A100),0)-9,1),0)
 
Upvote 1
Another one, this returns all the columns:

Book1
ABCDEFGH
1DateCodeNumberDateCodeNumber
21/1/2024A21/12/2024B37
31/2/2024B31/13/2024A41
41/3/2024A51/14/2024B43
51/4/2024B71/15/2024A47
61/5/2024A111/16/2024B53
71/6/2024B131/17/2024A59
81/7/2024A171/18/2024B61
91/8/2024B191/19/2024A67
101/9/2024A231/20/2024B71
111/10/2024B291/21/2024A73
121/11/2024A31
131/12/2024B37
141/13/2024A41
151/14/2024B43
161/15/2024A47
171/16/2024B53
181/17/2024A59
191/18/2024B61
201/19/2024A67
211/20/2024B71
221/21/2024A73
23
PortsPound
Cell Formulas
RangeFormula
F2:H11F2=INDEX(PortsPound!A2:C100,SEQUENCE(10,,COUNTA(PortsPound!A:A)-10),{1,2,3})
Dynamic array formulas.
 
Upvote 1
This is a bit longer but works from the bottom up so it will still work if you move your table further down the sheet.
Excel Formula:
=LET(rngA,PortsPound!A:A,
     lastCell,XLOOKUP(TRUE,rngA<>"",rngA,,0,-1),
     lastRow,ROW(lastCell),
     INDEX(rngA,lastRow-9):lastCell)
 
Upvote 1
Thanks for all the help on this matter. I tried each of them and they all worked. I do appreciate the time.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,212
Members
452,618
Latest member
Tam84

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