In Calc is it possible to use IF with OR in Calc?

Creating a stat tracker for my son’s little league team. I want one of the a cell that is tracking hits to display “-” if all of the cells that are tracking Singles, doubles, triples or HRs are 0. as soon as one of those four cells have data in them, than if should add the four cells together and get the total number. here is my formula: IF(L2=0 OR(M2=0,N2=0,O2=0),"-",(L2+M2+N2+O2)). I am getting 509 error. Is what I’m wanting to do even feasible? Thanks

as soon as one of those four cells have data in them, than if should add the four cells together and get the total number

So in essence, your requirement is “if L2 is not 0, or M2 is not 0, or N2 is not 0, or O2 is not 0, then add them together, else show -”? Or, alternatively, “if L2 is 0, and M2 is 0, and N2 is 0, and O2 is 0, then show -, else add them together”.

But maybe you don’t need the condition at all, and just want to sum up everything, and just use a custom number format string that would show ‘-’ when the sum cell value is 0? This is not the same (it will give different results if your data in L2:O2 may have negative values), but maybe your task is as simple as that?

I’m not worried about having negative because I’m tracking stats, which can never be a negative value. Any advice on how to create custom number format you mentioned?

Format Cells (Ctrl+1) help

Number Format Codes help

Something like 0;-0;"-"

The usage of the OR() function:

OR(L2=0;M2=0;N2=0;O2=0)

This worked great, I actually had to switch it to AND, but the syntax was perfect. Thanks!

Please click on the checkmark near my answer (make it green) if your problem is solved.