[Solved] Excel =ISDATE() equivalent
[Solved] Excel =ISDATE() equivalent
Hello Open Office Expert Gurus.
Can someone please tell me...
... 1. what is the OpenOffice Calc equivalent of Excel's ISDATE() function?
... 2. how to answer such questions for myself in the future?
Thanks.
Can someone please tell me...
... 1. what is the OpenOffice Calc equivalent of Excel's ISDATE() function?
... 2. how to answer such questions for myself in the future?
Thanks.
Last edited by MrProgrammer on Wed Dec 28, 2022 6:21 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] There is no ISDATE() function within Excel -- MrProgrammer, forum moderator
Reason: Tagged ✓ [Solved] There is no ISDATE() function within Excel -- MrProgrammer, forum moderator
Apache Open Office 4.1.13 on W10 Pro 64 (10.0.19045 Build 19045)
Re: Excel =ISDATE() equivalent
See Calc Functions
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Re: Excel =ISDATE() equivalent
Hallo
There is no equivalent for ISDATE neither in AOO nor LO.
There is no equivalent for ISDATE neither in AOO nor LO.
Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Re: Excel =ISDATE() equivalent
Thanks. Looks like the closest is ISNUMBER().
Apache Open Office 4.1.13 on W10 Pro 64 (10.0.19045 Build 19045)
Re: Excel =ISDATE() equivalent
How would the questioner explain without a reference to the mentioned Excel function what he (f/m) would accept as a "date". Is the question about strings "recognizeable" as dates or not? is it about cell contents or results and probably the formatting of resulting numbers?
Neither Excel nor Calc have an actual data type "DATE". I haven't access to any Excel, but the web is filled with lots of stuff about it. My terse research revealed that the mentioned function can be used in some versions of Excel as well in sheet formulas as in VBA code, but in others only in VBA code. Anyway it is kind of nonsense only testing if a given string is a "valid date". What a "valid date" is supposed to be must then be left to the locale settings. Since the treatment of dates is a nightmare anyway, even Calc can't do much better.
However ISNUMBER() is not usable as a surrogate because it will answer NO for any string passed to it without further checks. You may try the expressionto get something similar to the supposed ISDATE() of Excel. The problems concerning deprecated textual representations of dates will also be present in Calc then, of course.
Of much more value would be a user function testing a cell for whether it holds a date or not based on the NumberFormat the cell has assigned. NumberFormats (not the keys, but the objects) have a property .Type supporting the distinction (depending on some circumstances and with variants). An introspective UDF for the purpose isn't difficult to write.
Neither Excel nor Calc have an actual data type "DATE". I haven't access to any Excel, but the web is filled with lots of stuff about it. My terse research revealed that the mentioned function can be used in some versions of Excel as well in sheet formulas as in VBA code, but in others only in VBA code. Anyway it is kind of nonsense only testing if a given string is a "valid date". What a "valid date" is supposed to be must then be left to the locale settings. Since the treatment of dates is a nightmare anyway, even Calc can't do much better.
However ISNUMBER() is not usable as a surrogate because it will answer NO for any string passed to it without further checks. You may try the expression
Code: Select all
ISNUMBNER(DATEVALUE(myString))Of much more value would be a user function testing a cell for whether it holds a date or not based on the NumberFormat the cell has assigned. NumberFormats (not the keys, but the objects) have a property .Type supporting the distinction (depending on some circumstances and with variants). An introspective UDF for the purpose isn't difficult to write.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Excel =ISDATE() equivalent
[OP deleted]
Last edited by svanslyck on Thu Jan 23, 2025 7:49 pm, edited 1 time in total.
Apache Open Office 4.1.13 on W10 Pro 64 (10.0.19045 Build 19045)
Re: Excel =ISDATE() equivalent
https://a4accounting.com.au/excel-isdate-function/
Spreadsheets do not have any dates as a separate data type. All spreadsheet dates are formatted numbers. If Excel had ISDATE it would return whether a cell has a number that is formatted as date or not.Unfortunately Excel doesn’t have an ISDATE function. Excel’s macro language, VBA does, but there is no spreadsheet function that let’s you know if a cell contains a date. Well there is a partial workaround and you can also use VBA.
Last edited by Villeroy on Tue Dec 27, 2022 10:55 am, edited 1 time in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Excel =ISDATE() equivalent
Supported format codes from the Help of the CELL()/FORMAT function:
LibreOffice 6.1.6
Unfortunately some format codes are recognised as Dx, some others are recognized as G (depends on the locale of the format code or on the manual/style formatting?)...D1 = MMM-D-YY, MM-D-YY and similar formats
D2 = DD-MM
D3 = MM-YY
D4 = DD-MM-YYYY HH:MM:SS
D5 = MM-DD
D6 = HH:MM:SS AM/PM
D7 = HH:MM AM/PM
D8 = HH:MM:SS
D9 = HH:MM
G = All other formats
LibreOffice 6.1.6
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Excel =ISDATE() equivalent
It may be so. Nobody here finds it (and there are several experienced Excel users around here, I assure you), so it is not likely to be a builtin spreadsheet function.
I cannot claim 37 years experience with Excel, but I can read documentation. Microsoft's documentation is not my favorite, but from what I gather thence:
- Spreadsheet: Search reveals no ISDATE() spreadsheet function in Excel.
so if you have that, it seems to be an addon that you may have made yourself or gotten from others. - Database: There IS the IsDate() SQL function, which takes a string and determines whether it can be interpreted as a date.
This can be emulated by combining spreadsheet functions. - Macro code: There IS the VBA IsDate() function, which takes any argument and determines whether the data type is Date
Most likely to be useful with Variant type data, I guess. If this is what you need, other helpers know StarBasic type handling better than I do. Just comment below to the effect that "this is what I was after".
If you can use reversed logic, this returns TRUE when the data is NOT possible to read as a date:
Code: Select all
=ISERROR(DATEVALUE(<data>))Code: Select all
=NOT(ISERROR(DATEVALUE(<data>)))- Excel does not handle dates before the year 1900, so dates before that will be valid in Calc but not in Excel.
- Excel assumes 1900 was a leap year, so 29th. of february 1900 is considered a valid date in Excel but not in Calc
Last edited by keme on Tue Dec 27, 2022 2:42 pm, edited 1 time in total.
Re: Excel =ISDATE() equivalent
I have no record about every URL I visited before I made my statements. One of them still available in one of my browser tabs was https://www.techonthenet.com/excel/formulas/isdate.php .
There we find a typical example of such content pretending to be information, but actually being disinformation - at least to my brain.
They say that ISDATE "returns TRUE if the expression is a valid date." They do not say what a "valid date" is supposed to be. All the given examples are nonsense, imo. All values taking the expression position are strings (ISTEXT()=True) though the expression was introduced as Variant. One is "1/3/2004" without referring in any way to the locale dependency, a second one is "January 3, 2004" Aha. The only thing I can learn from such nonsense is that the author most likely writes in the USA.
Well, that's not an official text by MS, but it is the kind of "information" I next to always get if I try to reserach about the ways MS-Office works. A rare miracle of purity: Pure Time Wasting.
The fact that none of the examples would say "yes" when asked =ISNUMBER(expression) with an ordinary numbr in the expression position, but the OQer announced the usage of that formula as a surrogate for the missing =ISDATE(expression) was the reason for me to step in. I didn't expect my answer to be final, but mainly hoped to get clearer information concerning the question:
What is a "valid date" under this/that/another CONDITION?
Every vendor of software, help-text writer, poster of a related question should know that this must be the central concern.
To provide a standard function pretending to decide a question not giving a sufficiently clear specification of the correct answer under any expectable conditions should be seen as a criminal offense.
There we find a typical example of such content pretending to be information, but actually being disinformation - at least to my brain.
They say that ISDATE "returns TRUE if the expression is a valid date." They do not say what a "valid date" is supposed to be. All the given examples are nonsense, imo. All values taking the expression position are strings (ISTEXT()=True) though the expression was introduced as Variant. One is "1/3/2004" without referring in any way to the locale dependency, a second one is "January 3, 2004" Aha. The only thing I can learn from such nonsense is that the author most likely writes in the USA.
Well, that's not an official text by MS, but it is the kind of "information" I next to always get if I try to reserach about the ways MS-Office works. A rare miracle of purity: Pure Time Wasting.
The fact that none of the examples would say "yes" when asked =ISNUMBER(expression) with an ordinary numbr in the expression position, but the OQer announced the usage of that formula as a surrogate for the missing =ISDATE(expression) was the reason for me to step in. I didn't expect my answer to be final, but mainly hoped to get clearer information concerning the question:
What is a "valid date" under this/that/another CONDITION?
Every vendor of software, help-text writer, poster of a related question should know that this must be the central concern.
To provide a standard function pretending to decide a question not giving a sufficiently clear specification of the correct answer under any expectable conditions should be seen as a criminal offense.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Excel =ISDATE() equivalent
As ISDATE() is not an Excel function, it would help greatly if you could explain exactly what your ISDATE() function does. When we know exactly what you expect it to do then we may be able to suggest a way of doing it.
It would also help if you could upload a spreadsheet file (not an image) showing a number of examples where your function gives each of the various answers.
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Re: Excel =ISDATE() equivalent
All right, my mistake folks. I was working from home. There is no ISDATE() function within Excel.
Apache Open Office 4.1.13 on W10 Pro 64 (10.0.19045 Build 19045)