How to IF function to return date if True, 0 if False

  • Thread starter Thread starter Laura M.
  • Start date Start date
L

Laura M.

I am working on a spreadsheet where I need to determine
the number of days from Date1 to Date2. If there is not a
Date2, I want Excel to return a value of 0. Does anyone
know how to do this?
 
Laura,

=IF(Date2<>"", Date2-Date1, 0)

Format for ordinary numbers (not date), like General. Substitute your date
cells for Date1 and Date2.
 
Back
Top