ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Copy rows if greater than zero (https://www.excelbanter.com/excel-worksheet-functions/164002-copy-rows-if-greater-than-zero.html)

Andyb

Copy rows if greater than zero
 
I have a sheet where the user selects options up to 12 times, this
automatically generates a part number for each position.
On another sheet I use a list of possible part numbers with COUNTIF
functions in adjacent cells. This works fine, it puts "0" in every adjacent
cell then counts how many times each part number is chosen. (about 40 part
numbers)

What I want to do now is pull out any part numbers that don't have a zero
next to them and put them all in another list on another sheet with the
quantities next to them?Part nos. A77:A128
Quantity (COUNTIF) B77:B128

Thanks in advance

Max

Copy rows if greater than zero
 
Assume source data as specified is in Sheet1

In Sheet2,
Put in A1:
=IF(Sheet1!B770,ROW(),"")

Put in B1:
=IF(ROW()COUNT($A:$A),"",INDEX(Sheet1!A$77:A$128, SMALL($A:$A,ROW())))
Copy B1 to C1. Select A1:C1, fill down to C52 to cover the extent of source
data in Sheet1. Hide away col A. Cols B and C will return the required
results all neatly bunched at the top. Results will be dynamic to changes in
Sheet1.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"AndyB" wrote:
I have a sheet where the user selects options up to 12 times, this
automatically generates a part number for each position.
On another sheet I use a list of possible part numbers with COUNTIF
functions in adjacent cells. This works fine, it puts "0" in every adjacent
cell then counts how many times each part number is chosen. (about 40 part
numbers)

What I want to do now is pull out any part numbers that don't have a zero
next to them and put them all in another list on another sheet with the
quantities next to them?Part nos. A77:A128
Quantity (COUNTIF) B77:B128

Thanks in advance


Andyb

Copy rows if greater than zero
 
Works prefectly, Thanks.

"Max" wrote:

Assume source data as specified is in Sheet1

In Sheet2,
Put in A1:
=IF(Sheet1!B770,ROW(),"")

Put in B1:
=IF(ROW()COUNT($A:$A),"",INDEX(Sheet1!A$77:A$128, SMALL($A:$A,ROW())))
Copy B1 to C1. Select A1:C1, fill down to C52 to cover the extent of source
data in Sheet1. Hide away col A. Cols B and C will return the required
results all neatly bunched at the top. Results will be dynamic to changes in
Sheet1.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"AndyB" wrote:
I have a sheet where the user selects options up to 12 times, this
automatically generates a part number for each position.
On another sheet I use a list of possible part numbers with COUNTIF
functions in adjacent cells. This works fine, it puts "0" in every adjacent
cell then counts how many times each part number is chosen. (about 40 part
numbers)

What I want to do now is pull out any part numbers that don't have a zero
next to them and put them all in another list on another sheet with the
quantities next to them?Part nos. A77:A128
Quantity (COUNTIF) B77:B128

Thanks in advance


Max

Copy rows if greater than zero
 
welcome, AndyB
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"AndyB" wrote in message
...
Works prefectly, Thanks.





All times are GMT +1. The time now is 01:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com