xxxxxxxxxx
# Basic syntax:
=IF(condition, outcome_if_true, outcome_if_false)
# Note, the default setup for IF in Google Sheets is an IF ELSE
# Example usage:
=IF(A1 = "this text", "Houston, we have a match", 0)
# This returns "Houston, we have a match" if cell A1 is "this text",
# otherwise, it returns the number 0
xxxxxxxxxx
IF(A2 = "foo","A2 is foo")
IF(A2,"A2 was true","A2 was false")
IF(TRUE,4,5)
xxxxxxxxxx
# execute D2-C2 if both D2 and C2 are > 0, else show nothing "".
=IF( AND(D2>0,C2>0) , D2-C2 ,"")