LinEst with more than 65536 rows

JB3717

New Member
Joined
Jun 3, 2010
Messages
3
Hi guys.

I've been searching through the forums, but I can't seem to find anything on the subject.

I'm using the worksheet funtion "LinEst" in VBA to make regression in a monte carlo simulation. It works just fine with a low number of simulations, but I would like to make 100,000 simulations and then I get a type mismatch error message from the worksheetfunction.linest. I figured out through trial and error that the error occurs, when I try to do more than 65536 simulations. Doing a quick search on google I found out that 65536 was the maximum number of rows in previous versions of Excel. I use 2007, but it seems that the LinEst function hasn't been updated to handle the larger number of rows in Excel 2007. Does anybody know how I can resolve this issue or have any other piece of advice?

Regards

JB3717
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi JB

You did not say it but I guess you are working with arrays. In this case you are right, the worksheetfunction Linest() seems not to accept arrays with more than 64k elements.

A possible workaround is to copy the array into a range and use the worksheetfunction Linest() referring to the range.

I had no problem with:

Code:
Dim vLE As Variant
 
vLE = Application.WorksheetFunction.LinEst(Range("A1:A100000"))
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,123
Members
452,381
Latest member
Nova88

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