2

basically, I'd like to get the percentage differences between two numbers, but only if there is data/numbers in those cells.

I don't want the formula to run if there is not any data in the cell, as this will give me a div error.

player0
  • 124,011
  • 12
  • 67
  • 124
  • Just to be clear, all formulas in all cells always "run". What you do to control things is add conditions within your formula to control what happens when it is evaluated by Google Sheets. So using the IF function, as player0 has proposed, lets you do nothing if either A1 or B1 is empty. If both have values, then you can do something different, like find the percent difference. Let us know if this hasn't answered your question. – kirkg13 Nov 16 '20 at 01:14

1 Answers1

6

try IF:

=IF((A1<>"")*(B1<>""), A1-B1, )

if A1 and B1 is not empty do A1-B1 otherwise do nothing

player0
  • 124,011
  • 12
  • 67
  • 124