Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Need help with using LINEST()

Hi,

I would like to use the LINEST() function on two columns of data (Y,X for
example) in a worksheet in Excel- but I only want to include certain values.
I've used a function to return the X and Y values for the entries that
satisfy certain criteria, and #N/A for those that don't (e.g. there are some
rows that are full and rows that both have #N/A). Is there any way of only
including the elements that are numbers (as opposed to na) in the regression?

Alternatively, I've sorted the array so that the valued elements are at the
top and the #N/A elements are at the bottom. In theory I could then apply the
regression to the first n rows of the array only(where n = no. of rows of
numbers). Is there VBA code that I could write to do this? I'm struggling
with the element indexing system.

Thanks,

Sam
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default Need help with using LINEST()

LINEST() can only work with contiguous data. You must either create
intermediate arrays that contain only the data that you want to use, or else
not use LINEST().

If you are doing simple linear regression instead of multiple regression,
then you can use SLOPE(), INTERCEPT(). RSQ(), STEYX(), etc. These functions
do permit missing values, but error values (such as #N/A propagate, so you
probably want to use "NA" or "" for the values to omit.

Jerry

"SamCar" wrote:

Hi,

I would like to use the LINEST() function on two columns of data (Y,X for
example) in a worksheet in Excel- but I only want to include certain values.
I've used a function to return the X and Y values for the entries that
satisfy certain criteria, and #N/A for those that don't (e.g. there are some
rows that are full and rows that both have #N/A). Is there any way of only
including the elements that are numbers (as opposed to na) in the regression?

Alternatively, I've sorted the array so that the valued elements are at the
top and the #N/A elements are at the bottom. In theory I could then apply the
regression to the first n rows of the array only(where n = no. of rows of
numbers). Is there VBA code that I could write to do this? I'm struggling
with the element indexing system.

Thanks,

Sam

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Need help with using LINEST()

Thanks Jerry, useful stuff to know. I've found a way around it now.

Sam

"Jerry W. Lewis" wrote:

LINEST() can only work with contiguous data. You must either create
intermediate arrays that contain only the data that you want to use, or else
not use LINEST().

If you are doing simple linear regression instead of multiple regression,
then you can use SLOPE(), INTERCEPT(). RSQ(), STEYX(), etc. These functions
do permit missing values, but error values (such as #N/A propagate, so you
probably want to use "NA" or "" for the values to omit.

Jerry

"SamCar" wrote:

Hi,

I would like to use the LINEST() function on two columns of data (Y,X for
example) in a worksheet in Excel- but I only want to include certain values.
I've used a function to return the X and Y values for the entries that
satisfy certain criteria, and #N/A for those that don't (e.g. there are some
rows that are full and rows that both have #N/A). Is there any way of only
including the elements that are numbers (as opposed to na) in the regression?

Alternatively, I've sorted the array so that the valued elements are at the
top and the #N/A elements are at the bottom. In theory I could then apply the
regression to the first n rows of the array only(where n = no. of rows of
numbers). Is there VBA code that I could write to do this? I'm struggling
with the element indexing system.

Thanks,

Sam

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default LINEST() with missing values

Try this link: http://www.wwz.unibas.ch/witheo/yvan....html#LinEstNA
That should solve your problem, I hope.


EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LINESt [email protected] Excel Discussion (Misc queries) 1 December 8th 08 03:54 PM
Linest baron2ci Excel Worksheet Functions 0 April 8th 08 12:46 AM
LINEST() Bove Farm Excel Worksheet Functions 1 May 29th 06 05:54 AM
LINEST pjk@boro Excel Discussion (Misc queries) 2 February 20th 06 09:56 AM
Linest - Why did they do that? cseeton Excel Discussion (Misc queries) 2 March 11th 05 12:45 PM


All times are GMT +1. The time now is 05:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"