Function SEQUENCE is producing errors.

DRSteele

Well-known Member
Joined
Mar 31, 2015
Messages
2,640
Office Version
  1. 365
Platform
  1. Windows
The new Excel function SEQUENCE seems to be producing errors. I want a sequence of values from -50% to 50% with a 5 point step.

Put this in a cell and evaluate it in Edit mode by pressing f9.

=SEQUENCE(21,,-0.5,0.05)

Not only is the 0 a wonky exponent, some of the other values near zero are weird, to wit:
={-0.5;-0.45;-0.4;-0.35;-0.3;-0.25;-0.2;-0.15;-0.1;-0.0500000000000001;-6.93889390390723E-17;0.0499999999999999;0.0999999999999999;0.15;0.2;0.25;0.3;0.35;0.4;0.45;0.5}

I need the values to be exact and as expected. Does anyone have any insight?

I realise that one solution is to eliminate the decimals and divide it at the end, but that is not ideal as a solution.

=SEQUENCE(21,,-50,5)/100
 
Last edited:
I stumbled across this today, which says: "Fixed an issue where decimal values in the SEQUENCE function were not rounded correctly."

I tried =SEQUENCE(41,,-1,0.05) and it worked better but still produces an error at zero.
That article is very new and looks like only Office Insiders on the Fast Release channel would have it yet. I am on Insiders Monthly Channel (Targeted) and do not have that version build yet.
Having said that, the mentioned fix may or may not resolve your particular issue as there still is the fact that Excel does binary arithmetic not decimal arithmetic and it has a limit to its degree of accuracy. Here is another simple example. The result should be 0.1 just as it 'appears' in C1, but if we look more closely (D1) you see a different story.

20 05 04.xlsm
ABCD
11.21.10.10.09999999999999990000
Sample
Cell Formulas
RangeFormula
C1C1=A1-B1
D1D1=A1-B1
 
Upvote 0
Solution

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Thanks Peter. I get that too when the decimal place are extended out that far.
 
Upvote 0

Forum statistics

Threads
1,216,106
Messages
6,128,863
Members
449,473
Latest member
soumyahalder4

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