ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   diference in dates (https://www.excelbanter.com/excel-discussion-misc-queries/190394-diference-dates.html)

Pierre

diference in dates
 
hello
i have the following dates:

A B
1 07/06/2008 08/06/2008
2 02/06/2008 07/06/2008
3 03/06/2008 03/06/2008

i want a formula which gives me a difference between the 2 dates :
+1 for the first
-5 for the second
0 for the third
please help


Bernard Liengme

diference in dates
 
=B1-A1
format the cell to General
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"pierre" wrote in message
...
hello
i have the following dates:

A B
1 07/06/2008 08/06/2008
2 02/06/2008 07/06/2008
3 03/06/2008 03/06/2008

i want a formula which gives me a difference between the 2 dates :
+1 for the first
-5 for the second
0 for the third
please help




Niek Otten

diference in dates
 
What's the logic? Why is the first one + and the second one -?
If you accidentally have the dates in the second line in the wrong order:

=IF(B1A1,B1-A1,-(A1-B1))

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"pierre" wrote in message ...
| hello
| i have the following dates:
|
| A B
| 1 07/06/2008 08/06/2008
| 2 02/06/2008 07/06/2008
| 3 03/06/2008 03/06/2008
|
| i want a formula which gives me a difference between the 2 dates :
| +1 for the first
| -5 for the second
| 0 for the third
| please help
|



Niek Otten

diference in dates
 
Bernard is right; if you don't format as date, you don't have to care about the sign yourself!

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Niek Otten" wrote in message ...
| What's the logic? Why is the first one + and the second one -?
| If you accidentally have the dates in the second line in the wrong order:
|
| =IF(B1A1,B1-A1,-(A1-B1))
|
| --
| Kind regards,
|
| Niek Otten
| Microsoft MVP - Excel
|
| "pierre" wrote in message ...
|| hello
|| i have the following dates:
||
|| A B
|| 1 07/06/2008 08/06/2008
|| 2 02/06/2008 07/06/2008
|| 3 03/06/2008 03/06/2008
||
|| i want a formula which gives me a difference between the 2 dates :
|| +1 for the first
|| -5 for the second
|| 0 for the third
|| please help
||
|
|



ward376

diference in dates
 
I think Pierre wants the number of months between the dates.

Fpormat as general:
=IF(A2=B2,"The dates are the same.",IF(B2A2,MONTH(B2-A2),"The first
date is later than the second."))

Cliff Edwards


Niek Otten

diference in dates
 
<I think Pierre wants the number of months between the dates.

Could be. But the name suggests French, and then it would be days.


--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"ward376" wrote in message ...
|I think Pierre wants the number of months between the dates.
|
| Fpormat as general:
| =IF(A2=B2,"The dates are the same.",IF(B2A2,MONTH(B2-A2),"The first
| date is later than the second."))
|
| Cliff Edwards
|



Niek Otten

diference in dates
 
From Wikipedia:

Little endian forms, starting with the day
This sequence is common to the vast majority of the world's countries (see below for breakdown of countries by format).

a.. 16/11/2003, 16.11.2003, 16-11-2003 or 16-11-03
b.. 16th [of] November 2003 (The 'of' is included in speech, however it is considered bad practise to include it when written.)
c.. 16th November 2003
d.. 16 November 2003
e.. 16 Nov 2003

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Niek Otten" wrote in message ...
| <I think Pierre wants the number of months between the dates.
|
| Could be. But the name suggests French, and then it would be days.
|
|
| --
| Kind regards,
|
| Niek Otten
| Microsoft MVP - Excel
|
| "ward376" wrote in message ...
||I think Pierre wants the number of months between the dates.
||
|| Fpormat as general:
|| =IF(A2=B2,"The dates are the same.",IF(B2A2,MONTH(B2-A2),"The first
|| date is later than the second."))
||
|| Cliff Edwards
||
|
|



ward376

diference in dates
 
Yes, you're probably right. :(

Cliff Edwards


All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com