From 05e8075cda9d3ec822bcac4e77660303b25f1e24 Mon Sep 17 00:00:00 2001 From: dannywinrow <90405224+dannywinrow@users.noreply.github.com> Date: Sat, 14 Dec 2024 05:53:26 +0000 Subject: [PATCH] enh(excel) update keywords from 2016 to 2024 (#4182) * Update from 2016 to 2024 with new formulae Remove: FALSE|0 MIDBs SQL.REQUEST TRUE|0 Add: ARRAYTOTEXT BYCOL BYROW CHOOSECOLS CHOOSEROWS DROP EXPAND FALSE FILTER HSTACK IMAGE ISOMITTED LAMBDA LET MAKEARRAY MAP MIDB RANDARRAY REDUCE SCAN SEQUENCE SORT SORTBY STOCKHISTORY TAKE TEXTAFTER TEXTBEFORE TEXTSPLIT TOCOL TOROW TRUE UNIQUE VALUETOTEXT VSTACK WRAPCOLS WRAPROWS XLOOKUP XMATCH * Include missing functions I have left in SQL.REQUEST, this was from an addin that was included in Excel pre-2010 and is no longer used. Perhaps people want to highlight it in code for older Excel versions. I've removed MIDBs - this was clearly a typo and should have been MIDB which I have added. I've removed TRUE|0 and FALSE|0 and replaced them with TRUE and FALSE which are both callable as functions. The "|0" does not appear in the original archived link, so unless you can think of a reason for it (perhaps it handles the fact that TRUE and FALSE are also valid data not as a function) I will leave removed. * Update CHANGES.md * Update CHANGES.md * Update CHANGES.md --------- Co-authored-by: Josh Goebel --- CHANGES.md | 2 ++ src/languages/excel.js | 45 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6a3b2368a6..3bc696cca9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ Core Grammars: - fix(makefile) - allow strings inside `$()` expressions [aneesh98][] - enh(arcade) updated to ArcGIS Arcade version 1.29 [Kristian Ekenes][] - enh(css) add all properties listed on MDN (96 additions including `anchor-name`, `aspect-ratio`, `backdrop-filter`, `container`, `margin-trim`, `place-content`, `scroll-timeline`, ...) [BaliBalo][] +- enh(excel) add built-in functions for Excel 365 release to 2024 [Danny Winrow][] - enh(erlang) OTP 27 triple-quoted strings [nixxquality][] - enh(erlang) OTP 27 doc attribute [nixxquality][] - enh(erlang) OTP 27 Sigil type [nixxquality][] @@ -89,6 +90,7 @@ CONTRIBUTORS [Jake Leahy]: https://github.com/ire4ever1190 [Laurel King]: https://github.com/laurelthorburn [Kristian Ekenes]: https://github.com/ekenes +[Danny Winrow]: https://github.com/dannywinrow ## Version 11.10.0 diff --git a/src/languages/excel.js b/src/languages/excel.js index 39fdf8c270..b5869a0666 100644 --- a/src/languages/excel.js +++ b/src/languages/excel.js @@ -8,7 +8,7 @@ Category: enterprise /** @type LanguageFn */ export default function(hljs) { - // built-in functions imported from https://web.archive.org/web/20160513042710/https://support.office.com/en-us/article/Excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188 + // built-in functions imported from https://web.archive.org/web/20241205190205/https://support.microsoft.com/en-us/office/excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188 const BUILT_INS = [ "ABS", "ACCRINT", @@ -24,6 +24,7 @@ export default function(hljs) { "AND", "ARABIC", "AREAS", + "ARRAYTOTEXT", "ASC", "ASIN", "ASINH", @@ -57,6 +58,8 @@ export default function(hljs) { "BITOR", "BITRSHIFT", "BITXOR", + "BYCOL", + "BYROW", "CALL", "CEILING", "CEILING.MATH", @@ -72,6 +75,8 @@ export default function(hljs) { "CHISQ.INV.RT", "CHISQ.TEST", "CHOOSE", + "CHOOSECOLS", + "CHOOSEROWS", "CLEAN", "CODE", "COLUMN", @@ -143,6 +148,7 @@ export default function(hljs) { "DOLLARDE", "DOLLARFR", "DPRODUCT", + "DROP", "DSTDEV", "DSTDEVP", "DSUM", @@ -162,14 +168,16 @@ export default function(hljs) { "EVEN", "EXACT", "EXP", + "EXPAND", "EXPON.DIST", "EXPONDIST", "FACT", "FACTDOUBLE", - "FALSE|0", + "FALSE", "F.DIST", "FDIST", "F.DIST.RT", + "FILTER", "FILTERXML", "FIND", "FINDB", @@ -213,6 +221,7 @@ export default function(hljs) { "HEX2OCT", "HLOOKUP", "HOUR", + "HSTACK", "HYPERLINK", "HYPGEOM.DIST", "HYPGEOMDIST", @@ -221,6 +230,7 @@ export default function(hljs) { "IFNA", "IFS", "IMABS", + "IMAGE", "IMAGINARY", "IMARGUMENT", "IMCONJUGATE", @@ -263,6 +273,7 @@ export default function(hljs) { "ISNONTEXT", "ISNUMBER", "ISODD", + "ISOMITTED", "ISREF", "ISTEXT", "ISO.CEILING", @@ -270,12 +281,14 @@ export default function(hljs) { "ISPMT", "JIS", "KURT", + "LAMBDA", "LARGE", "LCM", "LEFT", "LEFTB", "LEN", "LENB", + "LET", "LINEST", "LN", "LOG", @@ -287,6 +300,8 @@ export default function(hljs) { "LOGNORM.INV", "LOOKUP", "LOWER", + "MAKEARRAY", + "MAP", "MATCH", "MAX", "MAXA", @@ -295,7 +310,7 @@ export default function(hljs) { "MDURATION", "MEDIAN", "MID", - "MIDBs", + "MIDB", "MIN", "MINIFS", "MINA", @@ -372,12 +387,14 @@ export default function(hljs) { "QUOTIENT", "RADIANS", "RAND", + "RANDARRAY", "RANDBETWEEN", "RANK.AVG", "RANK.EQ", "RANK", "RATE", "RECEIVED", + "REDUCE", "REGISTER.ID", "REPLACE", "REPLACEB", @@ -393,11 +410,13 @@ export default function(hljs) { "RRI", "RSQ", "RTD", + "SCAN", "SEARCH", "SEARCHB", "SEC", "SECH", "SECOND", + "SEQUENCE", "SERIESSUM", "SHEET", "SHEETS", @@ -409,10 +428,13 @@ export default function(hljs) { "SLN", "SLOPE", "SMALL", - "SQL.REQUEST", + "SORT", + "SORTBY", "SQRT", "SQRTPI", + "SQL.REQUEST", "STANDARDIZE", + "STOCKHISTORY", "STDEV", "STDEV.P", "STDEV.S", @@ -435,6 +457,7 @@ export default function(hljs) { "T", "TAN", "TANH", + "TAKE", "TBILLEQ", "TBILLPRICE", "TBILLYIELD", @@ -443,26 +466,33 @@ export default function(hljs) { "T.DIST.RT", "TDIST", "TEXT", + "TEXTAFTER", + "TEXTBEFORE", "TEXTJOIN", + "TEXTSPLIT", "TIME", "TIMEVALUE", "T.INV", "T.INV.2T", "TINV", + "TOCOL", + "TOROW", "TODAY", "TRANSPOSE", "TREND", "TRIM", "TRIMMEAN", - "TRUE|0", + "TRUE", "TRUNC", "T.TEST", "TTEST", "TYPE", "UNICHAR", "UNICODE", + "UNIQUE", "UPPER", "VALUE", + "VALUETOTEXT", "VAR", "VAR.P", "VAR.S", @@ -471,6 +501,7 @@ export default function(hljs) { "VARPA", "VDB", "VLOOKUP", + "VSTACK", "WEBSERVICE", "WEEKDAY", "WEEKNUM", @@ -478,7 +509,11 @@ export default function(hljs) { "WEIBULL.DIST", "WORKDAY", "WORKDAY.INTL", + "WRAPCOLS", + "WRAPROWS", "XIRR", + "XLOOKUP", + "XMATCH", "XNPV", "XOR", "YEAR",