Date Count

M

martins

Hi - I'm trying to create a spreadsheet which contains a column tha
calculates the number of days between dates and then a cell that add
up the total of the dates.
For the date calculation I have tried using =datedif(a1,b1,"d") - thi
is fine if you enter both dates however, if some are to follow i.e yo
have the date to enter in A1 but not b1 then the formula returns #NUM
and consequently the addition cell will not give any result in respec
of other rows where you have been able to enter both dates - you coul
say well dont enter any data until you have both dates however, th
purpose of the spreadsheet is to record info as its received. Ideall
I would like the date formula to return 0 if the date for cell b1 i
not yet known.

Sounds confusing but I dont know how to say any other way - can anyon
help
 
S

Sandy Mann

Try:

=IF(ISERROR(DATEDIF(A1,B1,"d")),0,DATEDIF(A1,B1,"d"))

--
HTH

Sandy
(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk
 
N

Nick Hodge

Martins

I hope I understand, try...

IF(OR(A1="",B1=""),0,DATEDIF(A1,B1,"d"))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 

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

Similar Threads


Top