Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Accessing individual elements of an array returned by a function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tkpmep@hotmail.com - 19 Mar 2008 03:58 GMT
If I call an Excel function (e.g. Linest) that returns an array (in
the case of Linest, the slope and the intercept), how can I access one
particular element of the array that is returned?

If I select two cells, type =Linest(a1:a10,b1:b10) in one and then hit
Ctl-Shift-Enter to enter an array formula, both the slope and the
intercept are returned, one in each cell. But what if I want just the
slope or just the intercept? I tried entering =Linest(a1:a10,b1:b10)
(1) in a single cell but got only an error. What am I doing wrong? I'm
aware that in this particular case, I could use the Slope() and
Intercept() functions separately to get what I want, but there has to
be a general solution for any function that returns an array.

Sincerely

Thomas Philips
Alan Beban - 19 Mar 2008 07:13 GMT
> If I call an Excel function (e.g. Linest) that returns an array (in
> the case of Linest, the slope and the intercept), how can I access one
[quoted text clipped - 12 lines]
>
> Thomas Philips
If the two cells you selected are in one column, you might try

=INDEX(Linest(A1:A10,B1:B10),1,1) for the slope,

=INDEX(Linest(A1:A10,B1:B10),2,1) for the intercept.

If the two selected cells were in one row, try

=INDEX(Linest(A1:A10,B1:B10),1,1) for the slope,

=INDEX(Linest(A1:A10,B1:B10),1,2) for the intercept.

Alan Beban
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.