Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Correlation of Variables

i'm tring to take the correlation of two different groups
of cells that i store the addresses of in variables. the
problem is that i need to keep the ranges for an arbitrary
group of cells, which is why i use the variables. here's an
example :

adrs = Range(Sheets("Sheet2").cells(2,col),
Sheets("Sheet2").cells(2,col).end(xlDown)).Address

adrs2 = Range(Sheets("Sheet2").cells(2,col),
Sheets("Sheet2").cells(2,col).end(xlDown)).Address

Range("A1")Sselect
' this next line is where i have problems with the addresses
ActiveCell.Formula = "=CORREL( adrs, adrs2 )"


any ideas what to put in the CORREL command to get it to
take the correlation of the two groups of cells? thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Correlation of Variables

Try something like

ActiveCell.Formula = "=CORREL(" & adrs & "," & adrs2 & ")"

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"NEWBIE" wrote in message
...
i'm tring to take the correlation of two different groups
of cells that i store the addresses of in variables. the
problem is that i need to keep the ranges for an arbitrary
group of cells, which is why i use the variables. here's an
example :

adrs = Range(Sheets("Sheet2").cells(2,col),
Sheets("Sheet2").cells(2,col).end(xlDown)).Address

adrs2 = Range(Sheets("Sheet2").cells(2,col),
Sheets("Sheet2").cells(2,col).end(xlDown)).Address

Range("A1")Sselect
' this next line is where i have problems with the addresses
ActiveCell.Formula = "=CORREL( adrs, adrs2 )"


any ideas what to put in the CORREL command to get it to
take the correlation of the two groups of cells? thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Correlation of Variables

that's perfect! thanks! one more question, how would i do
this if the cells i selected in the beginning were from
lets say sheet1 and the ActiveCell in this example was on
sheet2? any ideas?


-----Original Message-----
Try something like

ActiveCell.Formula = "=CORREL(" & adrs & "," & adrs2 & ")"

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"NEWBIE" wrote in

message
...
i'm tring to take the correlation of two different groups
of cells that i store the addresses of in variables. the
problem is that i need to keep the ranges for an arbitrary
group of cells, which is why i use the variables. here's an
example :

adrs = Range(Sheets("Sheet2").cells(2,col),
Sheets("Sheet2").cells(2,col).end(xlDown)).Address

adrs2 = Range(Sheets("Sheet2").cells(2,col),
Sheets("Sheet2").cells(2,col).end(xlDown)).Address

Range("A1")Sselect
' this next line is where i have problems with the addresses
ActiveCell.Formula = "=CORREL( adrs, adrs2 )"


any ideas what to put in the CORREL command to get it to
take the correlation of the two groups of cells? thanks



.

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
Correlation between 2 variables Damon Cavanagh Excel Worksheet Functions 0 July 1st 09 12:49 AM
Correlation analysis todd012976459210 Excel Worksheet Functions 6 October 16th 08 10:23 PM
Not at all clear on use of variables and/or object variables JMay-Rke Excel Discussion (Misc queries) 11 July 4th 08 06:36 PM
correlation James is Emusic Excel Worksheet Functions 1 April 25th 07 03:18 PM
Correlation between 2 or more variables [email protected] Excel Discussion (Misc queries) 2 November 25th 05 11:52 PM


All times are GMT +1. The time now is 04:29 PM.

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

About Us

"It's about Microsoft Excel"