Skip to content

Commit

Permalink
enh(excel) update keywords from 2016 to 2024 (#4182)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
dannywinrow and joshgoebel authored Dec 14, 2024
1 parent 195659e commit 05e8075
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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][]
Expand Down Expand Up @@ -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
Expand Down
45 changes: 40 additions & 5 deletions src/languages/excel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -24,6 +24,7 @@ export default function(hljs) {
"AND",
"ARABIC",
"AREAS",
"ARRAYTOTEXT",
"ASC",
"ASIN",
"ASINH",
Expand Down Expand Up @@ -57,6 +58,8 @@ export default function(hljs) {
"BITOR",
"BITRSHIFT",
"BITXOR",
"BYCOL",
"BYROW",
"CALL",
"CEILING",
"CEILING.MATH",
Expand All @@ -72,6 +75,8 @@ export default function(hljs) {
"CHISQ.INV.RT",
"CHISQ.TEST",
"CHOOSE",
"CHOOSECOLS",
"CHOOSEROWS",
"CLEAN",
"CODE",
"COLUMN",
Expand Down Expand Up @@ -143,6 +148,7 @@ export default function(hljs) {
"DOLLARDE",
"DOLLARFR",
"DPRODUCT",
"DROP",
"DSTDEV",
"DSTDEVP",
"DSUM",
Expand All @@ -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",
Expand Down Expand Up @@ -213,6 +221,7 @@ export default function(hljs) {
"HEX2OCT",
"HLOOKUP",
"HOUR",
"HSTACK",
"HYPERLINK",
"HYPGEOM.DIST",
"HYPGEOMDIST",
Expand All @@ -221,6 +230,7 @@ export default function(hljs) {
"IFNA",
"IFS",
"IMABS",
"IMAGE",
"IMAGINARY",
"IMARGUMENT",
"IMCONJUGATE",
Expand Down Expand Up @@ -263,19 +273,22 @@ export default function(hljs) {
"ISNONTEXT",
"ISNUMBER",
"ISODD",
"ISOMITTED",
"ISREF",
"ISTEXT",
"ISO.CEILING",
"ISOWEEKNUM",
"ISPMT",
"JIS",
"KURT",
"LAMBDA",
"LARGE",
"LCM",
"LEFT",
"LEFTB",
"LEN",
"LENB",
"LET",
"LINEST",
"LN",
"LOG",
Expand All @@ -287,6 +300,8 @@ export default function(hljs) {
"LOGNORM.INV",
"LOOKUP",
"LOWER",
"MAKEARRAY",
"MAP",
"MATCH",
"MAX",
"MAXA",
Expand All @@ -295,7 +310,7 @@ export default function(hljs) {
"MDURATION",
"MEDIAN",
"MID",
"MIDBs",
"MIDB",
"MIN",
"MINIFS",
"MINA",
Expand Down Expand Up @@ -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",
Expand All @@ -393,11 +410,13 @@ export default function(hljs) {
"RRI",
"RSQ",
"RTD",
"SCAN",
"SEARCH",
"SEARCHB",
"SEC",
"SECH",
"SECOND",
"SEQUENCE",
"SERIESSUM",
"SHEET",
"SHEETS",
Expand All @@ -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",
Expand All @@ -435,6 +457,7 @@ export default function(hljs) {
"T",
"TAN",
"TANH",
"TAKE",
"TBILLEQ",
"TBILLPRICE",
"TBILLYIELD",
Expand All @@ -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",
Expand All @@ -471,14 +501,19 @@ export default function(hljs) {
"VARPA",
"VDB",
"VLOOKUP",
"VSTACK",
"WEBSERVICE",
"WEEKDAY",
"WEEKNUM",
"WEIBULL",
"WEIBULL.DIST",
"WORKDAY",
"WORKDAY.INTL",
"WRAPCOLS",
"WRAPROWS",
"XIRR",
"XLOOKUP",
"XMATCH",
"XNPV",
"XOR",
"YEAR",
Expand Down

0 comments on commit 05e8075

Please sign in to comment.