3

I need help with what I'm sure is a simple formula that I just don't understand.

I have three columns. The first two hold my values and the third is meant to subtract them. However, when the first column is blank, I would like the third to also be blank. I have it close right now but when I type 0 in the first column, it treats that as a blank cell instead of using the 0 to give the sum.

Ex. of what I would like

expected result:
SCREEN SHOT OF WHAT I'M HOPING TO HAVE IT END UP LOOKING LIKE

I can't seem to figure out the formula for the third column.

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • Possible duplicate of https://stackoverflow.com/questions/18768020/if-statement-how-to-leave-cell-blank-if-condition-is-false-does-not-work – zx8754 Oct 23 '18 at 13:12

2 Answers2

2

Yes this is a quirk that goes right back to the dawn of spreadsheet applications; in an empty worksheet the formula =A1 written anywhere other than the top left cell will evaluate to 0.

One way, in Google Sheets, is to use something like

=IF(ISBLANK(A1), ,A1 - B1)

In Microsoft Excel you need to use double quotations characters in the second argument, noting that this injects a blank string into the output.

Bathsheba
  • 231,907
  • 34
  • 361
  • 483
1

This if statement (put in the 3rd Column) checks the first column if blank then just set cell as blank else perform the subtraction:- =IF(A1="", "", A1-B1)

Yuppski
  • 137
  • 2
  • 10