find a number in a column and return the entire row corresponding data

Cyberwoo

New Member
Joined
Dec 5, 2017
Messages
1
i have a sheet with data (sheet1) and i need a formula that can look in sheet1 column A for a number that can be found in sheet2 cell A1 (the number is 1103)
in sheet1 column A, the number 1103 appears several times and i need excel to find/look up the last 5 times that number (1103) appears and return the entire row (row1 in sheet1) into sheet2 next to where i have typed 1103.

so to specify a little

in sheet2, in cell A1-A5, is the number 1103 and i need the rest of the cells in sheet2 (A2:A20) to look into sheet1 column A for the latest 5 entries of the number 1103 (where 1103 is in the highest row number (if it is in row 1-5, 10-15, 25-30) it must return the values from sheet1 row 25-30) to sheet2 row1-5

also i sheet 2 i would need the same as above for other numbers (1257) but only the latest 2 entries, and also for several other numbers but if i can get the formula correct, then i can just adjust the number to look for and the number of rows to get data from.

so far i have been using {=INDEX(A1:A790;(MAX((A1:A790<>"")*ROW(A1:A790)))-ROW(A1)+1)} (ending with ctrl+shift+enter)
to return the last value in column A but i need some helt to get the formula to look for the last entrance of 1103 and return corresponding row. maybe this formula is no good for what i'm trying to do?
maybe i need to combine this with vlookup and/or indirect ?

thanks.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,214,621
Messages
6,120,568
Members
448,972
Latest member
Shantanu2024

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