4
2
Whether an Excel expression can be converted to the array form is sometimes hard to predict. For example, the following screenshot shows a table with a row of dates at the top, followed by four rows that reference the first. The first three (i.e. Excel rows 3, 4, and 5) each contain an array formula. The first two are fine, but the third, using EOMONTH(), breaks. Then Excel row 6 shows the same EOMONTH() formula, but in non-array form. It works fine. In B3:B5 and C7:I7 I've used FORMULATEXT() to display the functions in the various rows and cells.
I don't see anything obvious in the documentation for EOMONTH() that would predict the failure.
Is there a way to figure out which functions have this kind of limitation? (This is ostensibly the general form of my question, but it doesn't really help much).
The answer is not as simple as 'not working with arrays': EOMONTH actually works fine with array literals as input for either parameter, e.g. these formulas work fine:
=EOMONTH("1 Jan 2019", {1,2,3})
and=EOMONTH({"1 Jan 2019","1 May 2019","1 Aug 2019"}, 3)
and even=EOMONTH({"1 Jan 2019","1 May 2019","1 Aug 2019"}, {1;2;3})
. However, when the array comes from a sheet reference, it returns #VALUE, suggesting some internal processing quirk. – Govert – 2019-08-27T11:02:13.127Did you read to the end, @Govert ? It clearly states: "works with arrays, but not with ranges" – Aganju – 2019-08-27T15:18:34.213
You're completely right - I definitely did not see the last paragraph. Thank you for pointing that out - I now see the "- -" story too which is the most wonderful workaround and indeed works perfectly. – Govert – 2019-08-27T15:31:23.407
Any manipulation of the argument seems to work, including prepending "+" which seems a bit easier on the eye (but still magic). – Govert – 2019-08-27T15:46:34.900