# Excel subtraction if less than 0 not working

I'm currently working on some basic training to not lose the ability to work with Excel.

As a programmer, I know how conditions work but Excel is giving me a hard time xD.

In the column B I have the number that was previously subtracted while I have in C the amount that is going to be subtracted next.

``````=IF(OR(ISEMPTY(B33); B33 <= 0); ""; B33-C34)
``````

It works, except that the first field less than 0 will be rendered properly, but the following get `#VALUE!` as an error.

I don't know what's wrong. I'm checking if the field is empty or below or equal to 0.

• Show your data or it is impossible to answer your question Commented Jun 7, 2018 at 19:16
• I've added a screenshot of my data. Commented Jun 7, 2018 at 19:25
• Your getting the error because you are trying to do a mathematical operation on a string. B33 is "" which in excel is a string. Try changing it to "0" and see if that works (drop the "") Commented Jun 7, 2018 at 19:35
• It works that way but I want have these fields empty and not filled with 0. Isn't there a way to do this? Commented Jun 7, 2018 at 19:36
• I dont understand your logic completely so cant give you a solution, but if you first do an IF() to test if B33 is a blank string and if so do your maths on a zero instead of the string, then it might work Commented Jun 7, 2018 at 19:40

``````=IF( OR( B33 = ""; B33 <= C33); ""; B33-C33)