Formula to Ignore "0"

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,540
Office Version
  1. 365
Platform
  1. Windows
Hi,

could i please ask for some more help

i am looking for a formula to report from a list of data but to ignore the "0", and only report back with the values for orange and grey

I would like to see ;

Orange (1), Grey (4)

if this report was to change then the result would be reflected in the above formula

many thanks



Black
0​
0​
Blue
0​
0​
Yellow
0​
0​
Red
0​
0​
White
0​
0​
Green
0​
0​
Pink
0​
0​
Purple
0​
0​
Clear
0​
0​
Orange
1​
1​
Cream
0​
0​
Grey
4​
3​
Brown
0​
0​
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Like this?

Book1
ABCDEF
1ListVal1Val2ListVal1
2Black00Orange1
3Blue00Grey4
4Yellow00  
5Red00  
6White00
7Green00
8Pink00
9Purple00
10Clear00
11Orange11
12Cream00
13Grey43
14Brown00
15
Sheet2
Cell Formulas
RangeFormula
E2:F5E2=IFERROR(INDEX(A:A,SMALL(IF($B$2:$B$14>0,ROW($B$2:$B$14)),ROWS($E$2:$E2))),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Thansk Eric W,

Could A:A be a range ie A11:A30

I have tried to change but returns a 0

Thanks
 
Upvote 0
In this version of the formula, you'd leave the A:A range alone, but change the $B$2:$B$14 to $B$11:$B$30 in 2 places. If you want to change the A:A to match your range, you'd need to adapt it like so:

Book1
ABCDEF
1
2
3
4
5
6
7
8
9
10ListVal1Val2ListVal1
11Black00Orange1
12Blue00Grey4
13Yellow00  
14Red00  
15White00
16Green00
17Pink00
18Purple00
19Clear00
20Orange11
21Cream00
22Grey43
23Brown00
24
Sheet2
Cell Formulas
RangeFormula
E11:F14E11=IFERROR(INDEX(A$11:A$30,SMALL(IF($B$11:$B$30>0,ROW($B$11:$B$30)-ROW($B$11)+1),ROWS($E$11:$E11))),"")
Press CTRL+SHIFT+ENTER to enter array formulas.


The E$11:E11 range should refer to the cell the formula is in.
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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