0

I'm subtracting 2 dates. If the dates are <=5 then the answer is Y, if not then the answer is N. How do I ignore blank cells so I don't automatically get a Y? This is the formula I'm using.

=IF(G2-C2<=5,"Y","N")

1 Answers1

1

One way among many others is to use ISBLANK, OR, and nested IFs:

=IF(OR(ISBLANK(C2),ISBLANK(G2)),"",IF(G2-C2<=5,"Y","N"))
mpez0
  • 2,822
Wicket
  • 653
  • @Julie Wood, when the only cell in column C is blank, it will automatically get "N", but when the only cell in column G is blank, it will automatically get "Y". You could also choose to use the ISBLANK function for column G only. Also note that when G2-C2 is negative, "Y" will also be returned. – Viki Ji Aug 18 '21 at 06:54