zero in a range

K

kevin carter

hi
i have a column of data

coloum A
1 1
2 2
3 0
4 5
5 0
6 7
what i want to do is muliply them together
ie a1*a2*a3*a4*a5*s6 this will return zero because of the zero vaues
in A3 and A5

is it possible to ignore the zero values

thanks

kevin
 
K

keiji kounoike

What about this?

{=PRODUCT(IF(A1:A7=0,1,A1:A7))}

this is a array formula, so you need to press Shift+Ctrl+Enter instead
of just pressing Enter key.

Keiji
 
K

kevin carter

What about this?

{=PRODUCT(IF(A1:A7=0,1,A1:A7))}

this is a array formula, so you need to press Shift+Ctrl+Enter instead
of just pressing Enter key.

Keiji







- Show quoted text -

thanks
works a treat

kevin
 
K

kevin carter

thanks
works a treat

kevin- Hide quoted text -

- Show quoted text -

Another Question
When everything in the range is zero it returns 100% which is correct
using formula
can this formula be altered to show zero if everything is zero

thanks again

kevin
 
K

keiji kounoike

I assumed all data is positive. if this is not the case, my formula
doesn't work correctly. try a formula below in that case.

{=IF(AND(A1:A7=0),0,PRODUCT(IF(A1:A7=0,1,A1:A7)))}

Keiji
 
K

kevin carter

I assumed all data is positive. if this is not the case, my formula
doesn't work correctly. try a formula below in that case.

{=IF(AND(A1:A7=0),0,PRODUCT(IF(A1:A7=0,1,A1:A7)))}

Keiji





- Show quoted text -

thanks again

works a treat

kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top