Formula help!!!

J

japc90

I am trying to write a formula that will look in one cell and if it
finds a value greater than zero it pulls that number in. If the cell
is blank or the value is zero it will move to the next cell. If that
cell value is greater than zero it will pull it in if blank or equal
to zero it will go to the next cell.

Any help is appreciated.
 
R

Ron Coderre

With
A1:A3 containing either positive numbers or blanks

Try something like this:
=INDEX(A1:A3,SUMPRODUCT(MATCH(1,--(A1:A3>0),1)))

If none of the cells contains a positive value, the formula returns zero.

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
R

Ron Coderre

Doesn't it just figure.....I click the [Post] button *then* I see the flaw in
the formula.

Try this, instead:
=IF(COUNTIF(A1:A3,">0"),INDEX(A1:A3,SUMPRODUCT(MATCH(1,--(A1:A3>0),0))),0)

***********
Regards,
Ron

XL2002, WinXP
 
R

Ron Coderre

While the 2nd formula I posted works.....
try this much less fancy one:
=IF(A1>0,A1,IF(A2>0,A2,IF(A3>0,A3,0)))

Does that help?
***********
Regards,
Ron

XL2002, WinXP


Ron Coderre said:
Doesn't it just figure.....I click the [Post] button *then* I see the flaw in
the formula.

Try this, instead:
=IF(COUNTIF(A1:A3,">0"),INDEX(A1:A3,SUMPRODUCT(MATCH(1,--(A1:A3>0),0))),0)

***********
Regards,
Ron

XL2002, WinXP


Ron Coderre said:
With
A1:A3 containing either positive numbers or blanks

Try something like this:
=INDEX(A1:A3,SUMPRODUCT(MATCH(1,--(A1:A3>0),1)))

If none of the cells contains a positive value, the formula returns zero.

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
J

japc90

While the 2nd formula I posted works.....
try this much less fancy one:
=IF(A1>0,A1,IF(A2>0,A2,IF(A3>0,A3,0)))

Does that help?
***********
Regards,
Ron

XL2002, WinXP



Ron Coderre said:
Doesn't it just figure.....I click the [Post] button *then* I see the flaw in
the formula.
Try this, instead:
=IF(COUNTIF(A1:A3,">0"),INDEX(A1:A3,SUMPRODUCT(MATCH(1,--(A1:A3>0),0))),0)

XL2002, WinXP
"Ron Coderre" wrote:

- Show quoted text -

PERFECT! Thank you
 
Top