Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I only run a calculation in Google Sheets, if the cell is not empty?

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.

like image 870
Herman Brümmer Avatar asked Oct 19 '25 13:10

Herman Brümmer


1 Answers

try IF:

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

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

like image 92
player0 Avatar answered Oct 21 '25 04:10

player0