Formula Operators and Functions is a very good resource to reference.
From that, on the IF()
function
Determines if expressions are true or false. Returns a given value if true and another value if false.
Use
IF(logical_test, value_if_true, value_if_false)
and replace logical_test with the expression you want evaluated; replace value_if_true with the value you want returned if the expression is true; replace value_if_false with the value you want returned if the expression is false.
All of those arguments are required, and the true/false results need to have the same type.
Also, <boolean value> = true
can always be reduced to just <boolean value>
. Likewise, <boolean value> = false
can be reduced to just NOT(<boolean value>)
The general recommendation is to format formulas like code (one line only contains a single expression, indent an additional level after encountering an open parenthesis).
So what you're looking for is
IF(
Approvedcheck__c,
TODAY() - Sale_Date__c,
/* The "else" value needs to be the same type, so we use 0 */
0
)