formula or macro???

tweetiemaster

New Member
Joined
Aug 2, 2007
Messages
4
i am working on a project that i need excel to extract specific data from one sheet and add it to another sheet based on the value of the cell. for example. one column may have 300 rows of data but i may only need 15-20 rows out of that column depending on what the value is. or to make it simpler if i have 300 apples and some of those apples are labeled as bad apples i only want the bad apples from that column to show on another sheet. i have found an if statment similar to what i was looking for but it would only work on the entire row and not just the column. this particular tab is updated weekly (my raw data tab) each week adds 7 columns to the wooksheet and every other column has different critiera that needs to be met.

i basically need something that would say "if column B is not in the acceptable range then select column A and B and copy it to another worksheet"

Just FYI using Access is not an option for this particular project :cry:
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
i am working on a project that i need excel to extract specific data from one sheet and add it to another sheet based on the value of the cell. for example. one column may have 300 rows of data but i may only need 15-20 rows out of that column depending on what the value is. or to make it simpler if i have 300 apples and some of those apples are labeled as bad apples i only want the bad apples from that column to show on another sheet. i have found an if statment similar to what i was looking for but it would only work on the entire row and not just the column. this particular tab is updated weekly (my raw data tab) each week adds 7 columns to the wooksheet and every other column has different critiera that needs to be met.

i basically need something that would say "if column B is not in the acceptable range then select column A and B and copy it to another worksheet"

Just FYI using Access is not an option for this particular project :cry:

Sheet1 (source)
ExtractList tweetiemaster.xls
ABCD
1CODENAME
2400murphy
3400smith
4200johnson
5400smith
6200henry
7400cash
8400law
9400smith
10400rushton
11400rolls
12500smith
13100hartman
14200smith
15
Sheet1


Sheet2 (destination)
ExtractList tweetiemaster.xls
ABCD
1CODE
2400
38
4NAME
5murphy
6smith
7smith
8cash
9law
10smith
11rushton
12rolls
Sheet2


A3:

=COUNTIF(Sheet1!A2:A14,A2)

A5:

Control+shift+enter...

=IF(ROWS($A$5:A5)<=A$3,INDEX(Sheet1!$B$2:$B$14,SMALL(IF(Sheet1!$A$2:$A$14=A$2,ROW(Sheet1!$A$2:$A$14)-ROW(Sheet1!$A$2)+1),ROWS($A$5:A5))),"")

Then copy down.
 
Upvote 0
i have been able to recreate this on my current project but the problem that i run to now is that the first cell is populated and all other cells are blank after i have copied the formula for the # of cells needed. what could cause this problem. the values flashed for a second and that was it.
 
Upvote 0
i have been able to recreate this on my current project but the problem that i run to now is that the first cell is populated and all other cells are blank after i have copied the formula for the # of cells needed. what could cause this problem. the values flashed for a second and that was it.

Care to post the formulas as you implemented them?
 
Upvote 0
this is how i have the formula.

=IF(ROWS($A$5:A5)<=B3,INDEX('ND'!$A$3:$A$255,SMALL(IF('ND'!$C$3:$C255=B$3,ROW('ND'!$A$3:A$255)-ROW('ND'!$A$3)+1),ROWS($A$5:A5))),"")

i have 7 out of 22 rows populated 2 are blank and the rest are now showing as #n/a

one thing i did do differently was after i typed in the formula i did the ctrl+shft+enter... not sure if this would have made a difference or not
 
Upvote 0
this is how i have the formula.

=IF(ROWS($A$5:A5)<=B3,INDEX('ND'!$A$3:$A$255,SMALL(IF('ND'!$C$3:$C255=B$3,ROW('ND'!$A$3:A$255)-ROW('ND'!$A$3)+1),ROWS($A$5:A5))),"")

i have 7 out of 22 rows populated 2 are blank and the rest are now showing as #n/a

one thing i did do differently was after i typed in the formula i did the ctrl+shft+enter... not sure if this would have made a difference or not

What do you have in B3?

And, did you do anything with the COUNTIF formula I also suggested?
 
Upvote 0
b1 has the date
b2 has the total of the count if (in this case 22)
b3 has 1 this the value that all 22 items should have had on the previous sheet) similar to how you had code and 400 under it. i have everything going to the side
a1-a3 has the titles to the fields of b1-b3
b4 is my header row
 
Upvote 0
b1 has the date
b2 has the total of the count if (in this case 22)
b3 has 1 this the value that all 22 items should have had on the previous sheet) similar to how you had code and 400 under it. i have everything going to the side
a1-a3 has the titles to the fields of b1-b3
b4 is my header row

A5:

Control+shift+enter...

=IF(ROWS($A$5:A5)<=B$2,INDEX('ND'!$A$3:$A$255,SMALL(IF('ND'!$C$3:$C255=B$3,ROW('ND'!$A$3:A$255)-ROW('ND'!$A$3)+1),ROWS($A$5:A5))),"")

and copy down.
 
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,182
Members
448,948
Latest member
spamiki

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