Print returned array

grifdoogindoggy

New Member
Joined
Aug 27, 2019
Messages
21
I am looking for a way to print a returned array for a specific criteria.

For example, if the following values in a column do not equal 0, I would like to return them and print them in another column. I do not want to use a Macro.

i.e.
0
0
0
0
Apples
0
0
Oranges
0
0


Values: "apples","oranges"


Is this an index function? Thank you for any help.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Try:


Book1
ABC
1ListList2
20Apples
30Oranges
40
50
6Apples
70
80
9Oranges
100
110
12
Sheet6
Cell Formulas
RangeFormula
C2=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$20)/($A$2:$A$20<>0),ROWS($C$2:$C2))),"")
 
Upvote 0
Thank you! Is there a way I can tighten this up so that
i.e.
0
0
0
0
Apples
Apples
0
0
Oranges
0
0

Only returns
Apples
Oranges

And not apples twice?
 
Upvote 0
Filtering works, you can also change the formula to:

=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$20)/(($A$2:$A$20<>0)*(COUNTIF($C$1:$C1,$A$2:$A$20)=0)),1)),"")
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,185
Members
448,554
Latest member
Gleisner2

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