I'm not familiar with IF statements, Please help!

Copper Contributor

=If(cell is divisible by 50, then do so, if not return 0 zero)

How could I write this?

2 Replies

@slimstyles74 

=IF(MOD(A1,50),0,A1/50)

The function MOD() will return the remainder after the division so in this IF() statement if the remainder is NOT 0 then it is considered true and will return 0 but if the remainder is 0 then it is false and returns A1/50

 

@slimstyles74 

As variant to avoid IF()

=A1/50*(INT(A1/50)<>A1/50)