# datediff

3

#### 3Suk

hi,
anyone knows the function DATEDIFF which cannot be found in help?
I got it from one of the forum article.
My problem is : when the date in B4 is great than today's month, it will return #NUM!. Please help

=DATEDIF(B4,NOW(),"m")

Actually, I want to compare today month with the month in B4 which is a date, e.g. 4Jan,2013, with month of today. If it is 3 months ago, will do another thing.

Thanks,
Patrick.

I

#### isabelle

hi Patrick,

=IF(date1<date2,DATEDIF(date1,date2,"m"),DATEDIF(date2,date1,"m"))

isabelle

Le 2013-01-30 22:33, 3Suk a écrit :
hi,
anyone knows the function DATEDIFF which cannot be found in help?
I got it from one of the forum article.
My problem is : when the date in B4 is great than today's month, it will return #NUM!. Please help

=DATEDIF(B4,NOW(),"m")

Actually, I want to compare today month with the month in B4 which is a date, e.g. 4Jan,2013,

with month of today. If it is 3 months ago, will do another thing.

3

#### 3Suk

hi,

anyone knows the function DATEDIFF which cannot be found in help?

I got it from one of the forum article.

My problem is : when the date in B4 is great than today's month, it will return #NUM!. Please help

=DATEDIF(B4,NOW(),"m")

Actually, I want to compare today month with the month in B4 which is a date, e.g. 4Jan,2013, with month of today. If it is 3 months ago, will do another thing.

Thanks,

Patrick.

Isabelle,
That means, in the syntax =datedif(dateA,dateB,"m"), the condition is dateB MUST be greater than dateA, mustn't it?

Patrick.

I

#### isabelle

hi Patrick,

the condition is "if dateA is smaller than dateB",
if the condition is true, the formula will be DATEDIF (dateA; dateB, "m")
if the condition is false the formula will be DATEDIF (dateB; dateA, "m"))

isabelle

Le 2013-01-31 01:03, 3Suk a écrit :

3

#### 3Suk

hi Patrick,

the condition is "if dateA is smaller than dateB",

if the condition is true, the formula will be DATEDIF (dateA; dateB, "m")

if the condition is false the formula will be DATEDIF (dateB; dateA, "m"))

isabelle

Le 2013-01-31 01:03, 3Suk a écrit :
Isabelle,
got it, thanks.
Patrick.