IF and AND statement

  • Thread starter Thread starter lara5555
  • Start date Start date
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
 
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
 

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

Back
Top