Extract cells to a different sheet

sooshil

Board Regular
Joined
Feb 21, 2013
Messages
104
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Hello,

Here is my problem. I need a formula solution for this. NO VBA.

I have a single column (A:A) large (around 70000 rows, distinct) data.
From that data, I need to extract some of the rows to another sheet based upon the starting and ending cell values.

Here is the example for problem.
In a sheet (Sheet1) I have data something like this in Column A.

ABC123
PQR2456
BDP75-2
AQPR2
VWTWD
T-4PQCTD
WEFFF9P
SQOO5Y

I will set the starting and ending point in another sheet (Sheet2).
Suppose,
Starting Point = BDP75-2 (Suppose in Cell C2)
Ending Point = WEFFF9P (Suppose in Cell C3)

When I enter Ending point, I want all the values from starting point to ending point (including both) to be copied to the column A of Sheet2.
So the column A of Sheet2 looks like:

BDP75-2
AQPR2
VWTWD
T-4PQCTD
WEFFF9P

Any suggestions are highly appreciated. But, again NO VBA please.
 
Last edited:

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi Sooshil,

There's maybe an easier way to accomplish this but see if this suits, note the helper columns for your data page;


Book1
ABC
1RowsDataTRUE
21ABC123 
32PQR2456
43BDP75-21
54AQPR21
65VWTWD1
76T-4PQCTD1
87WEFFF9P1
98SQOO5Y
Sheet1
Cell Formulas
RangeFormula
A2=ROWS($A$2:A2)
C2=IF(AND(A2>=Sheet2!$C$2,A2<=Sheet2!$C$3),1,"")



Book1
ABC
1SelectionPostion
2StartBDP75-23
3EndWEFFF9P7
4
5
6Data
7BDP75-2
8AQPR2
9VWTWD
10T-4PQCTD
11WEFFF9P
Sheet2
Cell Formulas
RangeFormula
C2=INDEX(Sheet1!$A$2:$A$9,MATCH(Sheet2!B2,Sheet1!$B$2:$B$9,0))
C3=INDEX(Sheet1!$A$2:$A$9,MATCH(Sheet2!B3,Sheet1!$B$2:$B$9,0))
A7{=IF(ROWS(Sheet2!$A$7:A7)>($C$3-$C$2)+1,"",INDEX(Sheet1!$B$2:$B$9,SMALL(IF(Sheet1!$C$2:$C$9=1,ROW(Sheet1!$C$2:$C$9)-ROW(Sheet1!$C$2)+1),ROWS(Sheet2!$A$7:A7))))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi RasGhul

Thank you so much for your answer.
That was working as questioned. But, my situations is not something like that. Still, Thank you so much.

I too tried a lot and somehow managed to get the result I wanted.
I used, OFFSET and MATCH. But, I got problem with #N/A for the empty result cells.
Please help me to eliminate that #N/A error in my sheet.
For the sake of easiness, I did my work in same sheet, but I am very much aware to move that result in a different sheet as required.
Here is my file.

https://drive.google.com/file/d/1M-YJjuZW5ENCi138nAquayxohoX7Pr1C/view?usp=sharing

Thank you.
 
Upvote 0
I can't seem to get around the #N/A even with IFNA or IFERROR because the offset array is constant and includes the empty cells in column E.

This type of OFFSET array will potentially make this sheet very slow.


I managed to get the following to work without the helper columns;

Code:
=IF(ROWS($G$2:G2)>(MATCH($D$3,$A$1:$A$8,0)-MATCH($D$2,$A$1:$A$8,0)+1),"",INDEX($A$1:$A$8,SMALL(IF(ROW($A$1:$A$8)-ROW($A$1)+1>=MATCH($D$2,$A$1:$A$8,0),ROW($A$1:$A$8)-ROW($A$1)+1),ROWS($G$2:G2))))


https://docs.google.com/spreadsheets/d/1mMQoxymI11HmIIToPXPNRqj_5-vl_OZmDCNYnTytDOU/edit?usp=sharing
 
Upvote 0
Hi RasGhul

That's the perfect solution. Thank you so much for your time. I really appreciate this.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

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