How do I stop Excel from treating blank cells as zero?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm calculating the difference between two dates, such as

A1 - 1st September
B1 - 10th September

So B1-A1 returns 9, which is great.

But I only enter the dates in column B when a certain visit has been made,
and while the cells in B are blank, Excel treats them as zero (or 1st Januray
1900). So B1-A1 returns -39000 odd.

Is there a way to essentially stop it from calculating the formula until
both cells have a value entered?
 
Hi Michael
Try
=IF(OR(A1="",B1=""),"",B1-A1)

Regards

Roger Govier
 

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