Making a Formula that returns arrays skip the 0's

Denton1234

New Member
Joined
Jul 3, 2017
Messages
1
Hello,

I would like a formula that returns an array, that satisfies the is statement Column A = 2 - BUT I would like to skip the blanks

={N(OFFSET($B$1:$B$100,SMALL(IF($A$1:$A$100=2,ROW($B$1:$B$100)),ROW(INDIRECT("1:"&COUNTIF($B$1:$B$100,2)))),0))}

This gives me almost what I want, but it also gives me 0's when a 2 in column A matches a Blank cell in column B.

Is there a way to skip the blanks? So return an array of non 0 numbers If column A = 2



A B C
[TABLE="width: 241"]
<tbody>[TR]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]3.314[/TD]
[TD="align: right"]3.587[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]2.628[/TD]
[TD="align: right"]2.806[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]8.941[/TD]
[TD="align: right"]8.211[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]5.568[/TD]
[TD="align: right"]5.408[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]7.474[/TD]
[TD="align: right"]7.432[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]3.694[/TD]
[TD="align: right"]3.784[/TD]
[/TR]
</tbody>[/TABLE]


Many Thanks
Denton
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
How about this:

- Assuming you're in Excel 2010, click the File button in the top left, then choose Options, then choose Advanced, then scroll down to Display options for this worksheet, ensure the worksheet you want to make the change to is selected in the dropdown menu, then uncheck the "Show a zero in cells that have a zero value"

Assuming you don't have any other cells that have a value of 0 that you actually need/want to display, this should accomplish exactly what you want without making your formula needlessly complicated.
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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