diference in dates

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
 
N

Niek Otten

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

Niek Otten

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

ward376

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
 
N

Niek Otten

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

Niek Otten

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

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

Top