Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
martins
 
Posts: n/a
Default Calculating Days Between Dates


I use the following formula to calculate the days between dates and to
return zero when dates are the same –

=IF(OR(A1="",A2=""),0,DATEDIF(A1,A2, "d"))
How would I also allow for the eventuality where the date in cell A2 is
earlier than A1 and where the result would then be a minus figure ?

At present the formula returns a "Num" error when this happens


--
martins
------------------------------------------------------------------------
martins's Profile: http://www.excelforum.com/member.php...o&userid=31616
View this thread: http://www.excelforum.com/showthread...hreadid=526265

  #2   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson
 
Posts: n/a
Default Calculating Days Between Dates

If you're just counting the days between dates:

=a1-a2

(but format it as a number or general.)

martins wrote:

I use the following formula to calculate the days between dates and to
return zero when dates are the same –

=IF(OR(A1="",A2=""),0,DATEDIF(A1,A2, "d"))
How would I also allow for the eventuality where the date in cell A2 is
earlier than A1 and where the result would then be a minus figure ?

At present the formula returns a "Num" error when this happens

--
martins
------------------------------------------------------------------------
martins's Profile: http://www.excelforum.com/member.php...o&userid=31616
View this thread: http://www.excelforum.com/showthread...hreadid=526265


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.newusers
martins
 
Posts: n/a
Default Calculating Days Between Dates


Tried this but doeasnt seem to work or maybe I'm entering the formula
incorrectly - are you suggesting to substitue part of the formula ar as
an add in? could you clarify the whole formula

Thanks


--
martins
------------------------------------------------------------------------
martins's Profile: http://www.excelforum.com/member.php...o&userid=31616
View this thread: http://www.excelforum.com/showthread...hreadid=526265

  #4   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson
 
Posts: n/a
Default Calculating Days Between Dates

I'm just suggestion that you subtract one date from the other. You could add
your checks like:

=IF(OR(A1="",A2=""),0,a2-a1)





martins wrote:

Tried this but doeasnt seem to work or maybe I'm entering the formula
incorrectly - are you suggesting to substitue part of the formula ar as
an add in? could you clarify the whole formula

Thanks

--
martins
------------------------------------------------------------------------
martins's Profile: http://www.excelforum.com/member.php...o&userid=31616
View this thread: http://www.excelforum.com/showthread...hreadid=526265


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.newusers
martins
 
Posts: n/a
Default Calculating Days Between Dates


yes many thanks - I know understand - does the job well


--
martins
------------------------------------------------------------------------
martins's Profile: http://www.excelforum.com/member.php...o&userid=31616
View this thread: http://www.excelforum.com/showthread...hreadid=526265



  #6   Report Post  
Posted to microsoft.public.excel.newusers
FSt1
 
Posts: n/a
Default Calculating Days Between Dates

hi,
Try this. drop the dateif part and just use the cell addresses
=IF(OR(A1="",A2=""),0,A1-A2))

regards
FSt1

"martins" wrote:


I use the following formula to calculate the days between dates and to
return zero when dates are the same €“

=IF(OR(A1="",A2=""),0,DATEDIF(A1,A2, "d"))
How would I also allow for the eventuality where the date in cell A2 is
earlier than A1 and where the result would then be a minus figure ?

At present the formula returns a "Num" error when this happens


--
martins
------------------------------------------------------------------------
martins's Profile: http://www.excelforum.com/member.php...o&userid=31616
View this thread: http://www.excelforum.com/showthread...hreadid=526265


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating number of days between two dates that fall between two other dates [email protected] Excel Discussion (Misc queries) 5 October 26th 05 06:18 PM
calculating number of days (e.g., Mondays) between two dates girlfriend in school Excel Worksheet Functions 10 July 14th 05 07:21 PM
Brainteaser about Days Between Dates Johnny Excel Discussion (Misc queries) 5 April 4th 05 05:09 AM
Calculating for number of days when values are in dates pumper Excel Worksheet Functions 7 January 17th 05 04:52 AM
Help! I am stuck calculating Days, Hours, Mins please help OB1 Excel Worksheet Functions 3 November 15th 04 05:17 PM


All times are GMT +1. The time now is 06:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"