Prevent Spill Array

sparky2205

Well-known Member
Joined
Feb 6, 2013
Messages
507
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi folks,
I have the following setup:
1713956086224-png.110420

Pretty simple. DOW is a named range E2:E5.
I want to return a single value to B1, not a SPILL ARRAY.
I've tried using variations of the formula inserting @ at each of the obvious points but I either get the SPILL ARRAY or #VALUE error.
 

Attachments

  • 1713956086224.png
    1713956086224.png
    15.6 KB · Views: 57

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Use this formula instead:
Excel Formula:
=INDEX(DOW,H1)
 
Upvote 0
Solution
Hi Joe4,
I came across that when looking for solutions and it works fine.
I was just wondering if there is a way to prevent that spill array when using CHOOSE.
 
Upvote 0
It is because that is not how the CHOOSE function works. CHOOSE is not a replacement for INDEX, it is something entirely different.
You are telling it which value to return within the multiple VALUE arguments of the CHOOSE function.
The "Index_Num" value of 1 is telling it to return the value(s) found in the first Value argument, which is your entire DOW range.

For what you wanted to do, you would need to split up the range into multiple Value arguments, like this:
Excel Formula:
=CHOOSE(H1,E2,E3,E4,E5)

To read more on the CHOOSE function, see: CHOOSE function - Microsoft Support
 
Upvote 0
Thanks for the explanation Joe4. Every day is a learning day.
Have a good day.
 
Upvote 0
No problem!
I must admit that I have not used the CHOOSE function much myself, so I had to look it up.
So it was a learning experience for me as well!
 
Upvote 0
Here's an alternative without using the list in col E.
Excel Formula:
=TEXT(H1 + 1, "dddd")
 
Upvote 0
Here's an alternative without using the list in col E.
Excel Formula:
=TEXT(H1 + 1, "dddd")
It should probably be mentioned that this only works with days of the week (in case they just posted a simple example, and may have other data that they are working with).
But it does work nicely for the example posted!
 
Upvote 0
Thanks again folks.
That was just a simple example I posted to explain my predicament.
Nevertheless, good to know that TEXT option.
 
Upvote 0
Thanks again folks.
That was just a simple example I posted to explain my predicament.
Nevertheless, good to know that TEXT option.
Note it just works with the days in this case.
It makes clever use with how days are stored, and the various custom formatting options for dates.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top