Adjust formula for two cells that are 0 in iWork

50 Views Asked by At

I need help adding another rule to my formula, I need it to also say IF U17 and X17 both have 0 in them, then leave blank

Formula Y17

IF(OR(U17="",X17=""),"",IF(X17+V17=U17,"Push", IF(X17+V17>U17,W17,T17)))

If two cells have 0, then leave blank and also if two cells are blank to leave blank

Thanks

2

There are 2 best solutions below

0
zimp On BEST ANSWER

you need to use the AND function.

IF(OR(U17="",X17="",AND(U17=0,X17=0)),"",IF(X17+V17=U17,"Push", IF(X17+V17>U17,W17,T17)))

this will leave blank if either u17 or x17 is blank or both of them are 0

if you want to leave blank only if both of them are blank or both of them are 0 then the function is

IF(OR(AND(U17="",X17=""),AND(U17=0,X17=0)),"",IF(X17+V17=U17,"Push", IF(X17+V17>U17,W17,T17)))

you didn't specify in your request which one do you need.

0
bjbk On

The formula can be simplified to this:

IFERROR(IF(OR(A2,B2),A2+B2,""),"")

Since 0 is resolves to false and OR takes Boolean values, just check for 0 in both cells and return the empty string. Otherwise, if both are empty, the IFERROR will return the empty string as, for some reason, an empty string in Numbers is not treated as a Boolean false like in programming languages such as JavaScript.

See the example below. This will work in Numbers on macOS or iOS.

Table showing results of formula

Formula