SEQUENCE & RANDBETWEEN and the Mystery of #SPILL! Errors

jase71ds

Board Regular
Joined
Oct 23, 2006
Messages
137
Office Version
  1. 365
Platform
  1. Windows
I'm trying to understand what causes this #SPILL! error.

On a new workbook and a clean worksheet:
A1 = SEQUENCE(RANDBETWEEN(1,10))

Now, repeatedly toggle F9 (refresh) and observe the results.

Most of the time you'll get a shrinking or growing column of numbers, but often enough (about 30% of the time) you'll get a #SPILL! error.

Can someone explain to me what causes the #SPILL! error?
I can't discern a pattern.

Addendum #1.
To add to the mystery...

Now copy this formula to B1, and you'll get less results and a higher frequency of #SPILL! errors.

Now copy it all the way to Z1, and you'll hardly ever get A1 to give you results.

Summary: The more times the formula appears in the worksheet (or the workbook as a whole) the greater the frequency of #SPILL! errors.

At least, that is my experience.

What gives!!???
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Very weird. You can move the RANDBETWEEN out of the SEQUENCE, and it still does that. I tried RAND() instead of RANDBETWEEN and FILTER instead of SEQUENCE, and it still does it.

Book1
DEFGH
11a4#SPILL!
22b
33c
44d
55e
66f
77g
88h
99i
1010j
Sheet9
Cell Formulas
RangeFormula
G1G1=INT(RAND()*10)+1
H1H1=FILTER(E1:E10,D1:D10<=G1)


I wondered if it has something to do with volatile functions, so I tried using NOW() like this for the G1 formula:

=MOD(SECOND(NOW()),10)+1

but that did not cause the problem. It's almost like the formula is trying to SPILL onto the previous version of itself. That doesn't really make sense though. Something to do with the internal calculation chain I'd guess.
 
Upvote 0
Definitely odd, I also tried using RANDARRAY to return just one number in another cell & got the same thing , but if I put the RANDARRAY in the SEQUENCE function, I only ever got 1 row
+Fluff 1.xlsm
ABCD
11#SPILL!12
22
33
44
55
Main
Cell Formulas
RangeFormula
A1A1=SEQUENCE(RANDARRAY(1,,1,10,1))
B1B1=SEQUENCE(D1)
C1:C5C1=SEQUENCE(RANDBETWEEN(1,10))
D1D1=RANDARRAY(1,,1,10,1)
Dynamic array formulas.
 
Upvote 0
Good point about pulling RANDBETWEEN out of the SEQUENCE function.
I put RANDBETWEEN in A1, and then A2 through Z2 put =SEQUENCE($A$1)
Now they are all feeding off the same random number - some break, some don't. Completely inconsistent.

Definitely some sort of internal calculation issue / bug.
 
Upvote 0

Forum statistics

Threads
1,215,915
Messages
6,127,691
Members
449,398
Latest member
m_a_advisoryforall

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