Pick up the first positive (non Zero) number in a range

masim

Board Regular
Joined
Jun 19, 2003
Messages
130
Hi

here is my range starting from say C1.

-1920 -56 -988 0 0 95 25 1222

How can i pick first positive non zero number (in this case 95) ?

Thanks
Asim
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Not guaranteed, but it works with your sample data (negatives then zeroes then positives):

=INDEX(A1:A7,MATCH(1,A1:A7,1)+1,1)
 
Upvote 0
My range is horizontal and its not necessary that zeros always follow negative numbers it could be

-1920 -56 -988 95 0 0 25 1222

Sorry for the incomplete post earlier.

Regards
Asim
 
Upvote 0
Nopes

This formula captures 1222 as a result. I said at the begining that i want to capture first positive value i.e. 95 in this case.

Regards
Asim
 
Upvote 0
From one of Aladin's earlier posts is this ARRAY formula that should work (& I think I've reconstructed it correctly):

=INDEX(C1:J1,MATCH(TRUE,C1:J1>0,0))

--Tom
 
Upvote 0
Aladin Akyurek said:
masim said:
Thanks Andrew

Your solution works fine.

Regards
Asim

I don't think so. I hope Andrew will retract it.

I did put a caveat that it wasn't guaranteed. It works with the given data (negatives first). I agree it will not work in every scenario.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,114
Members
452,302
Latest member
TaMere

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