diference in dates

  • Thread starter Thread starter pierre
  • Start date Start date
P

pierre

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
 
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(B1>A1,B1-A1,-(A1-B1))

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| 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 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

| 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(B1>A1,B1-A1,-(A1-B1))
|
| --
| Kind regards,
|
| Niek Otten
| Microsoft MVP - Excel
|
|| 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
||
|
|
 
I think Pierre wants the number of months between the dates.

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

Cliff Edwards
 
<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

|I think Pierre wants the number of months between the dates.
|
| Fpormat as general:
| =IF(A2=B2,"The dates are the same.",IF(B2>A2,MONTH(B2-A2),"The first
| date is later than the second."))
|
| Cliff Edwards
|
 
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

| <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
|
||I think Pierre wants the number of months between the dates.
||
|| Fpormat as general:
|| =IF(A2=B2,"The dates are the same.",IF(B2>A2,MONTH(B2-A2),"The first
|| date is later than the second."))
||
|| Cliff Edwards
||
|
|
 
Back
Top