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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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