IF and AND statement

L

lara5555

Hi All,

I need to write a statement that is along the following:
=IF(F4=G4,1,0)+IF(F20=G20,1,0)+IF(G36=F36,1,0) but to only calulate is
the cells selected are greater than zero.

Any ideas?

Lara
 
M

macropod

Hi Lara,

If all of the paired cells must be greater than 0, try:
=IF((F4=G4)*(F4>0),1,0)*IF((F20=G20)*(F20>0),1,0)*IF((G36=F36)*(F36>0),3,0)

If some of the paired cells must be greater than 0, try:
=IF((F4=G4)*(F4>0),1,0)+IF((F20=G20)*(F20>0),1,0)+IF((G36=F36)*(F36>0),1,0)

Cheers
 
Top