3

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.

Screenshot

8
  • 1
    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.
    – Kazuto
    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?
    – Kazuto
    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

1 Answer 1

3

SOLUTION

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

This will leave the fields empty without the need of having zeros all over the place ^^

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .