Why does this LAMBDA that uses INDEX with array arguments behave strangely when saved in the Name Manager?

Jaden Joshua Amatuzzo 20 Reputation points
2026-07-24T23:00:50.1133333+00:00

Hello, I have encountered what appears to be some inconsistent behavior when a particular type of lambda is saved in the Name Manager. The issue seems to occurs when the LAMBDA uses INDEX with either the row_num or column_num argument supplied as an array. The following is a minimal reproducible example. The formula "=LAMBDA(arr,INDEX(arr,1,{1,2,4}))({1,2,3,4})" correctly evaluates to {1,2,4}. Now, upon saving the lambda as TEST in the name manager, the formula "=TEST({1,2,3,4})" also seems to spill to the expected array {1,2,4}. However, when this result is passed to another function, the behavior becomes inconsistent. For example, "=SUM(TEST({1,2,3,4}))" and "=COLUMNS(TEST({1,2,3,4}))" both evaluate to 1. In contrast, using the lambda inline instead of the defined name produces the expected results: "=SUM(LAMBDA(arr,INDEX(arr,1,{1,2,4}))({1,2,3,4}))" returns 7, and "=COLUMNS(LAMBDA(arr,INDEX(arr,1,{1,2,4}))({1,2,3,4}))" returns 3.

It appears that a named lambda using index with an array-valued row_num or column_num is not being treated as returning an array, despite spilling correctly when entered directly. I am unfortunately unable to attach a workbook to this post. In addition, it is not reproducible on every machine I have tested, but it is consistently reproducible in Excel for the Web. Here is a online workbook demonstrating this issue: [Moderator note: Personally Identifiable Information removed]. My current Excel is version 2607 on the Current Channel. Any insights into whether this is expected behavior or a bug would be appreciated.


Moved from Microsoft 365 and Office | Excel | Other | Windows

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

Answer accepted by question author
Jade Ng 15,480 Reputation points Microsoft External Staff Moderator
2026-07-25T05:16:14.64+00:00

Dear @Jaden Joshua Amatuzzo,

Thank you for taking the time to provide such a detailed report, along with a clear minimal reproducible example. The comparison between the inline LAMBDA and the named LAMBDA behavior is especially helpful for troubleshooting.

Based on the behavior you described, it appears that when a LAMBDA containing an INDEX function with an array-valued row_num or column_num argument is saved in Name Manager, Excel may not consistently recognize the result as an array when it is passed to another function. Although the named LAMBDA correctly spills the expected values, functions such as SUM() and COLUMNS() may treat the result differently than they do when the same LAMBDA is evaluated inline.

Since the issue is reproducible in Excel for the Web and not consistently reproducible across all environments, this behavior does not appear to align with the expected results demonstrated by the inline LAMBDA examples you provided.

At this time, the behavior suggests a potential issue within the Excel calculation engine rather than a problem with the formula syntax itself. To assist with further investigation, I sincerely recommend you try to create a support ticket from: Microsoft 365 Admin Center > Support > Help & Support. You can raise support ticket from: https://admin.microsoft.com/#/support/requests

The support team over there has higher permission than us to investigate the issue from background, they have more resource and correct escalation channel in handling this kind of issues. This would be a more efficient way in handling the case for you.  

For reference:Get support | Microsoft Docs       

Thanks for your patience and understanding so far. Hope you having a nice day and really much warm regards to you as well!  

Was this answer helpful?

1 person found this answer helpful.

2 additional answers

Sort by: Newest
  1. Rory Archibald 19,055 Reputation points Volunteer Moderator
    2026-08-04T13:15:01.7633333+00:00

    There have historically sometimes been issues with forcing a return of an array of values from a function (see this page for example: https://excelxor.wordpress.com/2014/11/04/coercing-array-returns-from-cse-resistant-formulas/#more-2591

    In this case, you can make your name work by just adding N() to your SUM formula:

    =SUM(N(TEST({1,2,3,4})))

    Was this answer helpful?

    0 comments No comments

  2. Dana D 100 Reputation points
    2026-07-26T12:44:48.9633333+00:00

    Hi. You have an "answer", but just to let you know, it works ok for me. (I would do it slightly differently thou)

    User's image

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.