ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Unexpected value with date calculation (https://www.excelbanter.com/excel-discussion-misc-queries/177743-unexpected-value-date-calculation.html)

Bob@HP

Unexpected value with date calculation
 
b2 is set to =DATE(2007,6,9)
i5 is set to =DATE(2007,6,10)
h10's formula is =DATEDIF(I5,B2,"Y")

I'm expecting an answer of 0, but I get 107. The format of H10 is set to
general.

Any suggestions?

Thanks,

Bob


FSt1

Unexpected value with date calculation
 
hi
try it this way,
=DATEDIF(B2,I5,"Y")

regards
FSt1

"Bob@HP" wrote:

b2 is set to =DATE(2007,6,9)
i5 is set to =DATE(2007,6,10)
h10's formula is =DATEDIF(I5,B2,"Y")

I'm expecting an answer of 0, but I get 107. The format of H10 is set to
general.

Any suggestions?

Thanks,

Bob


David Biddulph[_2_]

Unexpected value with date calculation
 
With those values the answer would be #NUM! (not zero), as you would have a
date difference of *minus* 1 day.
If you are getting an answer of 107, it looks as if I5 has a value of zero.
Check again that you've got the right values in the right cells, and that
your H10 formula refers to the cells you think it refers to.
If you put =I5 in a cell and format to General do you see 39243? If you put
=i5-b2 and format to general, do you see 1?
--
David Biddulph

"Bob@HP" wrote in message
...
b2 is set to =DATE(2007,6,9)
i5 is set to =DATE(2007,6,10)
h10's formula is =DATEDIF(I5,B2,"Y")

I'm expecting an answer of 0, but I get 107. The format of H10 is set to
general.

Any suggestions?

Thanks,

Bob




Tyro[_2_]

Unexpected value with date calculation
 
I get a #NUM error with those dates because the start date, 2007,6,10 is
greater than the end date 2007,6,9

Tyro

"Bob@HP" wrote in message
...
b2 is set to =DATE(2007,6,9)
i5 is set to =DATE(2007,6,10)
h10's formula is =DATEDIF(I5,B2,"Y")

I'm expecting an answer of 0, but I get 107. The format of H10 is set to
general.

Any suggestions?

Thanks,

Bob




Bob@HP

Unexpected value with date calculation
 
Thanks, found it - I had a merged cell with H10 and I10

"David Biddulph" wrote:

With those values the answer would be #NUM! (not zero), as you would have a
date difference of *minus* 1 day.
If you are getting an answer of 107, it looks as if I5 has a value of zero.
Check again that you've got the right values in the right cells, and that
your H10 formula refers to the cells you think it refers to.
If you put =I5 in a cell and format to General do you see 39243? If you put
=i5-b2 and format to general, do you see 1?
--
David Biddulph

"Bob@HP" wrote in message
...
b2 is set to =DATE(2007,6,9)
i5 is set to =DATE(2007,6,10)
h10's formula is =DATEDIF(I5,B2,"Y")

I'm expecting an answer of 0, but I get 107. The format of H10 is set to
general.

Any suggestions?

Thanks,

Bob





David Biddulph[_2_]

Unexpected value with date calculation
 
That's one of the reasons why most experts on this group recommend avoiding
merged cells like the plague.
Glad you found the answer.
--
David Biddulph

"Bob@HP" wrote in message
...
Thanks, found it - I had a merged cell with H10 and I10

"David Biddulph" wrote:

With those values the answer would be #NUM! (not zero), as you would have
a
date difference of *minus* 1 day.
If you are getting an answer of 107, it looks as if I5 has a value of
zero.
Check again that you've got the right values in the right cells, and that
your H10 formula refers to the cells you think it refers to.
If you put =I5 in a cell and format to General do you see 39243? If you
put
=i5-b2 and format to general, do you see 1?
--
David Biddulph

"Bob@HP" wrote in message
...
b2 is set to =DATE(2007,6,9)
i5 is set to =DATE(2007,6,10)
h10's formula is =DATEDIF(I5,B2,"Y")

I'm expecting an answer of 0, but I get 107. The format of H10 is set
to
general.

Any suggestions?

Thanks,

Bob








All times are GMT +1. The time now is 07:17 AM.

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