3

Is it possible to include a formula as the value_if_true within a logical statement in a cell in Google sheets? For instance, I would like to subtract the two rightmost digits in two adjacent cells, if that value in E23 is greater than the value in D23. I know how to return a yes or no:

=IF(RIGHT(E23,2)>RIGHT(D23,2),"YES","NO")

but can I perform an operation if the value is true? I've (blindly) tried:

 =IF(RIGHT(E23,2)>RIGHT(D23,2),=RIGHT(E23,2)-RIGHT(D23,2),"NO")

but of course, that returns an error. How would I perform the equivalent of that function for a true value?

2
=IF(RIGHT(E23,2)>RIGHT(D23,2),RIGHT(E23,2)-RIGHT(D23,2),"NO")

"=" not required inside if statement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.