ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Problems when using Date() function. (https://www.excelbanter.com/excel-worksheet-functions/448834-problems-when-using-date-function.html)

Jan Kronsell[_5_]

Problems when using Date() function.
 
I have the following function =Date(1900,1,1+A1) (A1 containing 367) and it returns 02-01-1901 (Danish notation) as expected. If A1 instead contains 41012, I expect it to return 14-04-12 (41013), but it does not. It returns 16-09-89
(32767).

Is there a limitation to the final argument in the Date function, that I'm not aware of and in that case, what is it=

Jan


Jan Kronsell[_5_]

Problems when using Date() function.
 
I discovered myself that the largest number possible is actually 32767, but I still can't find any documentation.

Jan

Den mandag den 3. juni 2013 23.05.23 UTC+2 skrev Jan Kronsell:
I have the following function =Date(1900,1,1+A1) (A1 containing 367) and it returns 02-01-1901 (Danish notation) as expected. If A1 instead contains 41012, I expect it to return 14-04-12 (41013), but it does not. It returns 16-09-89

(32767).



Is there a limitation to the final argument in the Date function, that I'm not aware of and in that case, what is it=



Jan



Ron Rosenfeld[_2_]

Problems when using Date() function.
 
On Mon, 3 Jun 2013 14:05:23 -0700 (PDT), Jan Kronsell wrote:

I have the following function =Date(1900,1,1+A1) (A1 containing 367) and it returns 02-01-1901 (Danish notation) as expected. If A1 instead contains 41012, I expect it to return 14-04-12 (41013), but it does not. It returns 16-09-89
(32767).

Is there a limitation to the final argument in the Date function, that I'm not aware of and in that case, what is it=

Jan


I cannot find any direct limitation information, but HELP does indicate that the digit is an integer. Perhaps that is why.

To accomplish the same result as what you are showing, you could use one of these formulas:

If the starting date will always be 1 Jan 1900
=A1+1

If the starting date could be some other date, a variation on:
=DATE(1900,1,1) + A1



All times are GMT +1. The time now is 04:59 AM.

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