close

Hi - I'm trying to create a spreadsheet which contains a column that
calculates the number of days between dates and then a cell that adds
up the total of the dates.
For the date calculation I have tried using =datedif(a1,b1,quot;dquot;) - this
is fine if you enter both dates however, if some are to follow i.e you
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 respect
of other rows where you have been able to enter both dates - you could
say well dont enter any data until you have both dates however, the
purpose of the spreadsheet is to record info as its received. Ideally
I would like the date formula to return 0 if the date for cell b1 is
not yet known.

Sounds confusing but I dont know how to say any other way - can anyone
help?--
martins
------------------------------------------------------------------------
martins's Profile: www.excelforum.com/member.php...oamp;userid=31616
View this thread: www.excelforum.com/showthread...hreadid=522849Try:

=IF(ISERROR(DATEDIF(A1,B1,quot;dquot;)),0,DATEDIF(A1,B1,quot;d quot;))

--
HTH

Sandy
with @tiscali.co.uk

quot;martinsquot; gt; wrote in
message ...
gt;
gt; Hi - I'm trying to create a spreadsheet which contains a column that
gt; calculates the number of days between dates and then a cell that adds
gt; up the total of the dates.
gt; For the date calculation I have tried using =datedif(a1,b1,quot;dquot;) - this
gt; is fine if you enter both dates however, if some are to follow i.e you
gt; have the date to enter in A1 but not b1 then the formula returns #NUM!
gt; and consequently the addition cell will not give any result in respect
gt; of other rows where you have been able to enter both dates - you could
gt; say well dont enter any data until you have both dates however, the
gt; purpose of the spreadsheet is to record info as its received. Ideally
gt; I would like the date formula to return 0 if the date for cell b1 is
gt; not yet known.
gt;
gt; Sounds confusing but I dont know how to say any other way - can anyone
gt; help?
gt;
gt;
gt; --
gt; martins
gt; ------------------------------------------------------------------------
gt; martins's Profile:
gt; www.excelforum.com/member.php...oamp;userid=31616
gt; View this thread: www.excelforum.com/showthread...hreadid=522849
gt;
Martins

I hope I understand, try...

IF(OR(A1=quot;quot;,B1=quot;quot;),0,DATEDIF(A1,B1,quot;dquot;))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HISquot;martinsquot; gt; wrote in
message ...
gt;
gt; Hi - I'm trying to create a spreadsheet which contains a column that
gt; calculates the number of days between dates and then a cell that adds
gt; up the total of the dates.
gt; For the date calculation I have tried using =datedif(a1,b1,quot;dquot;) - this
gt; is fine if you enter both dates however, if some are to follow i.e you
gt; have the date to enter in A1 but not b1 then the formula returns #NUM!
gt; and consequently the addition cell will not give any result in respect
gt; of other rows where you have been able to enter both dates - you could
gt; say well dont enter any data until you have both dates however, the
gt; purpose of the spreadsheet is to record info as its received. Ideally
gt; I would like the date formula to return 0 if the date for cell b1 is
gt; not yet known.
gt;
gt; Sounds confusing but I dont know how to say any other way - can anyone
gt; help?
gt;
gt;
gt; --
gt; martins
gt; ------------------------------------------------------------------------
gt; martins's Profile:
gt; www.excelforum.com/member.php...oamp;userid=31616
gt; View this thread: www.excelforum.com/showthread...hreadid=522849
gt;

Thanks guys - -problem solved ---
martins
------------------------------------------------------------------------
martins's Profile: www.excelforum.com/member.php...oamp;userid=31616
View this thread: www.excelforum.com/showthread...hreadid=522849

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()