Copy rows that contain "A" or "B" or "C" in a column into a new sheet

ygar

New Member
Joined
May 2, 2020
Messages
13
Office Version
  1. 2010
Platform
  1. Windows
I want to copy rows to another sheet when the text in column B of the main sheet is either Blue, Red or White.
I tried the following for white, but I can't make it work with multiple "OR" matching values.
IF(Working!$B2="White",ROW(),"").
My other formula =IFERROR(INDEX(Working!A:A,SMALL($M:$M,ROW($A1)),1),"")

It could be either a modification to the same formula or a different formula, I basically one to copy the rows that contain Red or Blue or White in column B into a separate spreadsheet.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I want to copy rows to another sheet when the text in column B of the main sheet is either Blue, Red or White.
I tried the following for white, but I can't make it work with multiple "OR" matching values.
IF(Working!$B2="White",ROW(),"").
My other formula =IFERROR(INDEX(Working!A:A,SMALL($M:$M,ROW($A1)),1),"")

It could be either a modification to the same formula or a different formula, I basically one to copy the rows that contain Red or Blue or White in column B into a separate spreadsheet.
Sorry, I want to clarify that the rows to copy should contain either *Blue* or *Red* or *White* (partial match)
 
Upvote 0
Consider using Power Query to identify rows that meet requirement and delete all others. If you provide a sample upload with XL2BB then I will provide the Mcode for this to happen.
 
Upvote 0
@ygar
If you want to do it manually, then try this.
Say, B$2:B$100 is the search Range where you have text containing either 'Blue' or 'Red' or 'White'.
In C2 type the following formula and press Ctrl + Shift + Enter.
Copy C2 and paste from C3 to C100.
In C1 type Blue and press enter.
This will display the list of partial matches of 'Blue' beginning from C2 .
=IF($C$1="","",IFERROR(INDEX(B$2:B$100,SMALL(IF(ISNUMBER(SEARCH($C$1,B$2:B$100)),ROW(B$2:B$100)-ROW(B$2)+1),ROWS(B$2:B2))),""))
Now copy the list of 'Blue' and using paste values, paste it in the destination sheet.
Again type White in C1 and get results for 'White'.
 
Upvote 0

Forum statistics

Threads
1,215,026
Messages
6,122,738
Members
449,094
Latest member
dsharae57

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