Forum Discussion

GVtequila62's avatar
GVtequila62
Copper Contributor
Jan 14, 2024

Formula

A need a little help writing a formula.  

 

My question is 

 

IF(A1>0.00 then I don't want it to add cells A2:A5)   If(A1=0.00 I want it to add cells A1:A5)

 

Thanks for your help.

 

GV

  • GVtequila62,

    Enter the following formula in the cell where you want to see the sum

     

     

     

    =IF(A1>0,"",SUM(A2:A5))

     

     

     

    Since you only want to add A1:A5 when A1=0, then there is no point in including the value of A1 in the sum (because it will only add zero to the sum) - hence the range you want to add is in fact A2:A5

    You haven't specified what you want to do if A1<0 - in the formula above, if A1<0 only A2:A5 gets summed.

     

  • RedNectar's avatar
    RedNectar
    Brass Contributor

    GVtequila62,

    Enter the following formula in the cell where you want to see the sum

     

     

     

    =IF(A1>0,"",SUM(A2:A5))

     

     

     

    Since you only want to add A1:A5 when A1=0, then there is no point in including the value of A1 in the sum (because it will only add zero to the sum) - hence the range you want to add is in fact A2:A5

    You haven't specified what you want to do if A1<0 - in the formula above, if A1<0 only A2:A5 gets summed.