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.
 
Hello Laura,

Try the following.
If Date1 is in cell A1 and Date2 is in cell B1 then the
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top