Skip to content
Open
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added

- Added a message after `npm i hyperformula` that points AI assistants to the SKILLS file. The message needs `--foreground-scripts` to be visible in npm, and pnpm 10 needs the `postinstall` script to be approved first. [#1829](https://github.com/handsontable/hyperformula/pull/1829)
- Added the `TYPE` and `ERROR.TYPE` information functions: `TYPE` returns the code of a value's type (number, text, boolean, error, array), and `ERROR.TYPE` returns the code of an error, or `#N/A` for any other value. [#1813](https://github.com/handsontable/hyperformula/pull/1813)

### Fixed

Expand Down
2 changes: 2 additions & 0 deletions docs/guide/list-of-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ See a full list of differences between HyperFormula, Microsoft Excel, and Google
| EOMONTH function | =EOMONTH(DATE(2019, 7, 31), 1) | Type of the returned value: `CellValueDetailedType.NUMBER_DATE`. This is non-compliant with the [OpenDocument](https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html) standard, which defines the return type as a Number, while describing it as a Date serial number through the function summary. | Cell auto-formatted as **date** | Cell auto-formatted as **regular number** |
| EDATE and EOMONTH results in February 1900 | =EDATE(DATE(1900, 1, 31), 1)<br><br>=EOMONTH(DATE(1900, 1, 31), 1) | With the [`leapYear1900`](/api/interfaces/configparams.md#leapyear1900) option set to `true`, February 1900 has 29 days, so both examples return 29 February 1900 (serial `60` with `nullDate` set to 1899-12-31). With the default `false`, both return 28 February 1900. | 28 February 1900 for both examples. Google Sheets does not treat 1900 as a leap year. | 28 February 1900 (serial `59`) for both examples. Excel keeps the 1900 leap day only in the serial-to-date mapping (`DAY(60)` is `29`); its month arithmetic treats February 1900 as having 28 days, so no `EDATE` or `EOMONTH` result is ever serial `60`. |
| Empty cells in lookup search | =XLOOKUP(3, A1:A4, A1:A4, "NF", 0, 2)<br>where A1:A4 = 1, 2, (empty), 3 | Empty cells are skipped during the search. A value that is present is found even when it sits past an interspersed empty cell (exact match is gap-independent), and approximate `MATCH`/`VLOOKUP`/`HLOOKUP`/`XLOOKUP` skip empty cells — but not empty strings — when finding the lower/upper bound. Returns `3`. On an all-empty range in a binary search mode, HyperFormula returns the `if_not_found` result (never row 1). | Skips empty cells in approximate search (parity with HyperFormula). | With binary search modes (`search_mode` ±2), a range with interspersed empty cells is not strictly sorted; per Excel's documentation the result may be invalid, so a value past an empty cell is not reliably found. On an all-empty range in a binary mode, Excel returns the first row's value. |
| TYPE of a computed array | =TYPE(ROW(A1:A2)+0)<br>=TYPE(A1:A2+1)<br>=TYPE(IF(TRUE(), A1:A2)) | `ROW` and `COLUMN` over a multi-cell range count as arrays only when passed to `TYPE` directly, so `TYPE(ROW(A1:A2)+0)` gives `1`. With [`useArrayArithmetic`](/api/interfaces/configparams.md#usearrayarithmetic) set to `false` (the default), `A1:A2+1` and `IF(TRUE(), A1:A2)` are reduced to the cell in the formula's row, so `TYPE` classifies that cell's value (`1` for a number) in rows 1 and 2, and gives `16` (`#VALUE!`) in any other row. With `useArrayArithmetic` set to `true`, both give `64`. | Not checked. | Returns `64` for all three examples. |
| ERROR.TYPE function | =ERROR.TYPE(#NULL!) | HyperFormula has no `#NULL!` error, so the code 1 is never returned and the literal does not parse. `#CYCLE!`, which Excel does not have, has no code and gives `#N/A`. | Not checked. | Returns `1` for `#NULL!`. |

## Built-in functions

Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/csCZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'EOMONTH',
ERF: 'ERF',
ERFC: 'ERFC',
'ERROR.TYPE': 'CHYBA.TYP',
EVEN: 'ZAOKROUHLIT.NA.SUDÉ',
EXACT: 'STEJNÉ',
EXP: 'EXP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'PROČISTIT',
TRUE: 'PRAVDA',
TRUNC: 'USEKNOUT',
TYPE: 'TYP',
UNICHAR: 'UNICHAR',
UNICODE: 'UNICODE',
UNIQUE: 'UNIQUE',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/daDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'SLUT.PÅ.MÅNED',
ERF: 'FEJLFUNK',
ERFC: 'FEJLFUNK.KOMP',
'ERROR.TYPE': 'FEJLTYPE',
EVEN: 'LIGE',
EXACT: 'EKSAKT',
EXP: 'EKSP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'FJERN.OVERFLØDIGE.BLANKE',
TRUE: 'TRUE',
TRUNC: 'AFKORT',
TYPE: 'VÆRDITYPE',
UNICHAR: 'UNICHAR',
UNICODE: 'UNICODE',
UNIQUE: 'ENTYDIGE',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/deDE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'MONATSENDE',
ERF: 'GAUSSFEHLER',
ERFC: 'GAUSSFKOMPL',
'ERROR.TYPE': 'FEHLER.TYP',
EVEN: 'GERADE',
EXACT: 'IDENTISCH',
EXP: 'EXP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'GLÄTTEN',
TRUE: 'WAHR',
TRUNC: 'KÜRZEN',
TYPE: 'TYP',
UNICHAR: 'UNIZEICHEN',
UNICODE: 'UNICODE',
UNIQUE: 'EINDEUTIG',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/enGB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'EOMONTH',
ERF: 'ERF',
ERFC: 'ERFC',
'ERROR.TYPE': 'ERROR.TYPE',
EVEN: 'EVEN',
EXACT: 'EXACT',
EXP: 'EXP',
Expand Down Expand Up @@ -241,6 +242,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'TRIM',
TRUE: 'TRUE',
TRUNC: 'TRUNC',
TYPE: 'TYPE',
UNICHAR: 'UNICHAR',
UNICODE: 'UNICODE',
UNIQUE: 'UNIQUE',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/esES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const dictionary: RawTranslationPackage = {
EOMONTH: 'FIN.MES',
ERF: 'FUN.ERROR',
ERFC: 'FUN.ERROR.COMPL',
'ERROR.TYPE': 'TIPO.DE.ERROR',
EVEN: 'REDONDEA.PAR',
EXACT: 'IGUAL',
EXP: 'EXP',
Expand Down Expand Up @@ -239,6 +240,7 @@ export const dictionary: RawTranslationPackage = {
TRIM: 'ESPACIOS',
TRUE: 'VERDADERO',
TRUNC: 'TRUNCAR',
TYPE: 'TIPO',
UNICHAR: 'UNICHAR',
UNICODE: 'UNICODE',
UNIQUE: 'UNICOS',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/fiFI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'KUUKAUSI.LOPPU',
ERF: 'VIRHEFUNKTIO',
ERFC: 'VIRHEFUNKTIO.KOMPLEMENTTI',
'ERROR.TYPE': 'VIRHEEN.LAJI',
EVEN: 'PARILLINEN',
EXACT: 'VERTAA',
EXP: 'EKSPONENTTI',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'POISTA.VÄLIT',
TRUE: 'TOSI',
TRUNC: 'KATKAISE',
TYPE: 'TYYPPI',
UNICHAR: 'UNICODEMERKKI',
UNICODE: 'UNICODE',
UNIQUE: 'AINUTKERTAISET.ARVOT',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/frFR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'FIN.MOIS',
ERF: 'ERF',
ERFC: 'ERFC',
'ERROR.TYPE': 'TYPE.ERREUR',
EVEN: 'PAIR',
EXACT: 'EXACT',
EXP: 'EXP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'SUPPRESPACE',
TRUE: 'VRAI',
TRUNC: 'TRONQUE',
TYPE: 'TYPE',
UNICHAR: 'UNICAR',
UNICODE: 'UNICODE',
UNIQUE: 'UNIQUE',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/huHU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'HÓNAP.UTOLSÓ.NAP',
ERF: 'HIBAF',
ERFC: 'HIBAF.KOMPLEMENTER',
'ERROR.TYPE': 'HIBA.TÍPUS',
EVEN: 'PÁROS',
EXACT: 'AZONOS',
EXP: 'KITEVŐ',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'KIMETSZ',
TRUE: 'IGAZ',
TRUNC: 'CSONK',
TYPE: 'TÍPUS',
UNICHAR: 'UNIKARAKTER',
UNICODE: 'UNICODE',
UNIQUE: 'EGYEDI',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/idID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'AKHIR.BULAN',
ERF: 'ERF',
ERFC: 'ERFC',
'ERROR.TYPE': 'ERROR.TYPE',
EVEN: 'GENAP',
EXACT: 'IDENTIK',
EXP: 'EXP',
Expand Down Expand Up @@ -241,6 +242,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'HAPUS.SPASI',
TRUE: 'BENAR',
TRUNC: 'POTONG',
TYPE: 'TYPE',
UNICHAR: 'UNIKARAKTER',
UNICODE: 'UNICODE',
UNIQUE: 'UNIQUE',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/itIT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'FINE.MESE',
ERF: 'FUNZ.ERRORE',
ERFC: 'FUNZ.ERRORE.COMP',
'ERROR.TYPE': 'ERRORE.TIPO',
EVEN: 'PARI',
EXACT: 'IDENTICO',
EXP: 'EXP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'ANNULLA.SPAZI',
TRUE: 'VERO',
TRUNC: 'TRONCA',
TYPE: 'TIPO',
UNICHAR: 'CARATT.UNI',
UNICODE: 'UNICODE',
UNIQUE: 'UNICI',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/nbNO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'MÅNEDSSLUTT',
ERF: 'FEILF',
ERFC: 'FEILFK',
'ERROR.TYPE': 'FEIL.TYPE',
EVEN: 'AVRUND.TIL.PARTALL',
EXACT: 'EKSAKT',
EXP: 'EKSP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'TRIMME',
TRUE: 'SANN',
TRUNC: 'AVKORT',
TYPE: 'VERDITYPE',
UNICHAR: 'UNICODETEGN',
UNICODE: 'UNICODE',
UNIQUE: 'UNIK',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/nlNL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'LAATSTE.DAG',
ERF: 'FOUTFUNCTIE',
ERFC: 'FOUT.COMPLEMENT',
'ERROR.TYPE': 'TYPE.FOUT',
EVEN: 'EVEN',
EXACT: 'GELIJK',
EXP: 'EXP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'SPATIES.WISSEN',
TRUE: 'WAAR',
TRUNC: 'GEHEEL',
TYPE: 'TYPE',
UNICHAR: 'UNITEKEN',
UNICODE: 'UNICODE',
UNIQUE: 'UNIEK',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/plPL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'NR.SER.OST.DN.MIEŚ',
ERF: 'FUNKCJA.BŁ',
ERFC: 'KOMP.FUNKCJA.BŁ',
'ERROR.TYPE': 'NR.BŁĘDU',
EVEN: 'ZAOKR.DO.PARZ',
EXACT: 'PORÓWNAJ',
EXP: 'EXP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'USUŃ.ZBĘDNE.ODSTĘPY',
TRUE: 'PRAWDA',
TRUNC: 'LICZBA.CAŁK',
TYPE: 'TYP',
UNICHAR: 'ZNAK.UNICODE',
UNICODE: 'UNICODE',
UNIQUE: 'UNIKATOWE',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/ptPT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'FIMMÊS',
ERF: 'FUNERRO',
ERFC: 'FUNERROCOMPL',
'ERROR.TYPE': 'TIPO.ERRO',
EVEN: 'PAR',
EXACT: 'EXATO',
EXP: 'EXP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'ARRUMAR',
TRUE: 'VERDADEIRO',
TRUNC: 'TRUNCAR',
TYPE: 'TIPO',
UNICHAR: 'CARACTUNI',
UNICODE: 'UNICODE',
UNIQUE: 'EXCLUSIVOS',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/ruRU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'КОНМЕСЯЦА',
ERF: 'ФОШ',
ERFC: 'ДФОШ',
'ERROR.TYPE': 'ТИП.ОШИБКИ',
EVEN: 'ЧЁТН',
EXACT: 'СОВПАД',
EXP: 'EXP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'СЖПРОБЕЛЫ',
TRUE: 'ИСТИНА',
TRUNC: 'ОТБР',
TYPE: 'ТИП',
UNICHAR: 'ЮНИСИМВ',
UNICODE: 'UNICODE',
UNIQUE: 'УНИК',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/svSE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'SLUTMÅNAD',
ERF: 'FELF',
ERFC: 'FELFK',
'ERROR.TYPE': 'FEL.TYP',
EVEN: 'JÄMN',
EXACT: 'EXAKT',
EXP: 'EXP',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'RENSA',
TRUE: 'SANT',
TRUNC: 'AVKORTA',
TYPE: 'VÄRDETYP',
UNICHAR: 'UNICHAR',
UNICODE: 'UNICODE',
UNIQUE: 'UNIK',
Expand Down
2 changes: 2 additions & 0 deletions hyperformula/src/i18n/languages/trTR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const dictionary: RawTranslationPackage = {
EOMONTH: 'SERİAY',
ERF: 'HATAİŞLEV',
ERFC: 'TÜMHATAİŞLEV',
'ERROR.TYPE': 'HATA.TİPİ',
EVEN: 'ÇİFT',
EXACT: 'ÖZDEŞ',
EXP: 'ÜS',
Expand Down Expand Up @@ -239,6 +240,7 @@ const dictionary: RawTranslationPackage = {
TRIM: 'KIRP',
TRUE: 'DOĞRU',
TRUNC: 'NSAT',
TYPE: 'TÜR',
UNICHAR: 'UNICODEKARAKTERİ',
UNICODE: 'UNICODE',
UNIQUE: 'BENZERSİZ',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import {FunctionDoc} from '../FunctionDescription'
* `VERSION` function, whose structural metadata lives in `protectedFunctionMetadata.ts` rather than in a plugin.
*/
export const INFORMATION_DOCS: Record<string, FunctionDoc> = {
'ERROR.TYPE': {
category: 'Information',
shortDescription: 'Returns the number of an error type: 2 for #DIV/0!, 3 for #VALUE!, 4 for #REF!, 5 for #NAME?, 6 for #NUM!, 7 for #N/A and 9 for #SPILL!, or #N/A for a value that is not an error or an error without a number.',
parameters: [{name: 'value', description: 'The value or cell reference to inspect; any value that is not an error, a number or text included, results in #N/A.'}],
documentationUrl: 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html',
examples: ['=ERROR.TYPE(1/0)', '=ERROR.TYPE(A1)', '=ERROR.TYPE(NA())'],
},
ISBINARY: {
category: 'Information',
shortDescription: 'Returns TRUE if provided value is a valid binary number.',
Expand Down Expand Up @@ -130,6 +137,13 @@ export const INFORMATION_DOCS: Record<string, FunctionDoc> = {
documentationUrl: 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html',
examples: ['=SHEETS()', '=SHEETS(A1:B3)'],
},
TYPE: {
category: 'Information',
shortDescription: 'Returns the type of a value: 1 for a number or an empty cell, 2 for text, 4 for a logical value, 16 for an error and 64 for an array or a multi-cell range.',
parameters: [{name: 'value', description: 'The value or reference to classify; an error is reported as 16 instead of being propagated, and a single-cell range is classified by the value it holds.'}],
documentationUrl: 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html',
examples: ['=TYPE(A1)', '=TYPE("text")', '=TYPE(A1:B2)'],
},
// VERSION is a protected function (its plugin, VersionPlugin, is kept out of the general registry so it can
// never be unregistered; see `FunctionRegistry._protectedPlugins`). Its structural metadata (parameters,
// repeatLastArgs) is authored separately in `PROTECTED_FUNCTION_METADATA`.
Expand Down
Loading
Loading