Lookup Row and move to another sheet

7839matth

New Member
Joined
Dec 29, 2013
Messages
17
Good morning,

I am hoping somebody could assist me with an formula i would like to write in order to do the following:

If any row in column AL equals 1

Move that entire row to another sheet (Sheet 1 for this example.)

As a side note; there may be large gaps between rows where column AL contains 1, can these gaps be removed so when the rows move to Sheet 1 they are displayed in a compact manner?

Thank you for any help in advance!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi 7839,

Copy this formula across the entire row & drag down as far as needed to return all possible rows.


This array formula needs to be entered with CTRL+SHIFT+Enter;

Code:
=IF(ROWS($A$1:A1)>COUNTIF(Sheet2!$AL$1:$AL$10,1),"",INDEX(Sheet2!A$1:A$10,SMALL(IF(Sheet2!$AL$1:$AL$10=1,ROW(Sheet2!$A$1:$A$10)-ROW(Sheet2!$A$1)+1),ROWS($A$1:A1))))

If done successfully the formula will show curly brackets at each end eg;

{=IF(ROWS($A$1:A1)>COUNTIF(Sheet2!$AL$1:$AL$10,1),"",INDEX(Sheet2!A$1:A$10,SMALL(IF(Sheet2!$AL$1:$AL$10=1,ROW(Sheet2!$A$1:$A$10)-ROW(Sheet2!$A$1)+1),ROWS($A$1:A1))))}
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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