DATEVALUE in ONLYOFFICE Spreadsheet Editor
Convert date text to a date serial in ONLYOFFICE with explicit locale and date-system scope, serial checks and safe parsing alternatives.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: under the inspected year-first parser path and the 1900 date system, =DATEVALUE("2025-01-01") is expected to return 45658. The result is a number that you can format as a date.
Availability and evidence scope
- Introduced: Original introduction release is not established by the sources checked.
- Available: Documented in current unversioned ONLYOFFICE function help, checked October 18, 2026.
- Implementation inspected: Official SDKJS v10.0.0.169, commit
3679e0375a758d7dc59d31337a45461be3525ed8. This establishes a source snapshot, not identical behavior in every installed editor. - Retired or deprecated: Retirement or formal deprecation is not established by these sources. A legacy spelling is not automatically a removed function.
- Testing: Examples are independently calculated or labeled source predictions. No ONLYOFFICE application or calculation-engine execution was performed. No native screenshot or general import/export guarantee is claimed.
Use English names and comma separators as shown; adapt separators outside quoted text if your locale requires semicolons. Keep full precision in calculations and round only the displayed summary.
Syntax and the parsing boundary
=DATEVALUE(date_text)
Exactly one argument is registered. The function converts the input to text, sends it to the editor’s format parser and requires a recognized date/time result. It then returns the integer portion of the parsed serial. It does not simply remove punctuation or interpret every eight-digit identifier as a date.
The parser uses the active/default culture’s date order, separators and month-name information. These examples use a four-digit year first, ASCII hyphens and complete dates; the inspected parser contains an explicit year-first branch when the first numeric date component exceeds 1000. That source path is not a native test of every locale. Check representative imported strings in the actual editor and regional settings before converting a full column.
The official help describes dates from January 1, 1900 through December 31, 9999. That documented range does not make every textual spelling of those dates recognizable or every workbook date system interchangeable.
Step-by-step: distinguish text, serial and display
- On a fresh worksheet, enter the literal text 2025-01-01 in A2. Use a leading apostrophe if needed to keep the entry as text; the apostrophe is an entry marker, not part of the intended date text.
- In B2 enter
=DATEVALUE(A2). - Under the stated 1900 date-system/parser assumptions, format B2 as a number to inspect expected serial 45658.
- Apply a date format to B2. The same underlying number should represent January 1, 2025; formatting does not perform a second conversion.
- Compare with a separately constructed
=DATE(2025,1,1)value to check the intended calendar date in that workbook.
For modern dates in the 1900 system, the independent serial calculation counts days from December 30, 1899. Python calendar arithmetic gives 45658 for January 1, 2025 and 45351 for February 29, 2024. The compatibility treatment of the fictitious 1900 leap day means this convenient modern-date epoch should not be blindly extended to every early-1900 edge case.
Advanced case: remove the time part of recognized date-time text
For text 2025-01-01 18:00, the inspected parser represents the date and time components. Eighteen hours is 18/24 = 0.75 of a day. The parsed value is therefore expected to be 45658.75 under the same date-system assumptions, and DATEVALUE returns its integer part, 45658.
This behavior is useful when a report needs the calendar-date portion of a recognized timestamp. It does not preserve the original time, timezone or textual spelling. Keep the original string if you need an audit trail. A timestamp ending in a timezone marker or using another syntax is not established by this example.
If year, month and day are already separate numeric fields, prefer a direct DATE construction instead of concatenating a locale-dependent string and parsing it again. The parser is useful for existing date text; it is not necessary for arithmetic date inputs.
Ambiguous dates and missing components
A string such as 03/04/2025 can mean March 4 or April 3 depending on culture. A successful numeric result is not proof that the intended order was used. Compare a known asymmetric date, inspect the resulting year/month/day, and document the input convention before applying the conversion broadly.
The inspected parser can supply the current year when a recognized date string lacks a year. That makes incomplete-date results depend on when they are parsed. Use full four-digit years for reproducible worksheets and avoid treating a short form such as “Jan 1” as a permanent fixed date.
The source also supports a 1904 date-system path. For a modern calendar date, its serial differs from the 1900-system number; January 1, 2025 corresponds mathematically to 44196 in the 1904 system. Do not compare raw serials from different date systems without accounting for that difference. Merely applying the same cell format does not reconcile the epochs.
Errors and limits
If the format parser does not recognize a date/time result, DATEVALUE returns the value-type error category, conventionally #VALUE!. The invalid-text case below is a source prediction, not an observed application display. The source checks a general date/time flag rather than only a date flag, so do not infer that every accepted input necessarily supplied a calendar date.
Numeric inputs are first converted to text; an already numeric date serial is not the same task as a recognized date-text string. Keep numeric date values numeric where possible. Multi-cell ranges and arrays have additional selection behavior, so these single-value examples do not establish a spill-array conversion workflow.
The pinned format-parser source supports the specific parsing statements above. It was inspected, not executed. Localized month names, two-digit years, timezone notation, hidden whitespace and arbitrary import formats remain unverified here.
Reproducible checks
These are independent mathematical expectations or identified source-error predictions, not native application results. Preserve full input precision when reproducing them.
| Formula | Expected result |
|---|---|
=DATEVALUE("2025-01-01") |
45658 |
=DATEVALUE("2024-02-29") |
45351 |
=DATEVALUE("2025-01-01 18:00") |
45658 |
=DATEVALUE("not-a-date") |
#VALUE! |
Compatibility and related functions
Use the exact input representation, date system and day-count convention above when moving a workbook between products. Similar names are not a general cross-version or file-format compatibility guarantee.
DATE constructs dates from numeric components. YEAR, MONTH and DAY help inspect the calendar meaning of a parsed serial.
First-party references
- Official DATEVALUE help, checked October 18, 2026.
- Pinned SDKJS implementation, including parameter validation and numerical helpers.