Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default using arrays to complete calcs

All,

I am trying to use a column of my 2-dimensional array in a worksheet
function. I unfortunately do not know how to do this. This is what I have
so far below (cut from certain portions). I am trying to use the
correllation function to compare the column data of arrTop to another column
data of arrTop. I'm thinking of making the columns I'm comparing ranges
first, then putting them in the correl function?

Thanks for any help,
Matt


ReDim arrTop(1 To LastRow, 1 To 11)
arrTop = ActiveCell.Offset(-ActiveCell.Row + 1, -12).Range("B" &
StartingRow & ":L" & EndingRow).Value

For j = 1 To 10
For k = 2 To 10
ActiveCell.Offset(j, k).Value =
Application.WorksheetFunction.Correl(arrTop(, j), arrTop(, k))
Next k
Next j




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default using arrays to complete calcs


Dana DeLouis's response to your "simplify" post on 04/17/2009 answers this question too.
--
Jim Cone
Portland, Oregon USA




Matt S"

wrote in message
All,
I am trying to use a column of my 2-dimensional array in a worksheet
function. I unfortunately do not know how to do this. This is what I have
so far below (cut from certain portions). I am trying to use the
correllation function to compare the column data of arrTop to another column
data of arrTop. I'm thinking of making the columns I'm comparing ranges
first, then putting them in the correl function?
Thanks for any help,
Matt

ReDim arrTop(1 To LastRow, 1 To 11)
arrTop = ActiveCell.Offset(-ActiveCell.Row + 1, -12).Range("B" &
StartingRow & ":L" & EndingRow).Value

For j = 1 To 10
For k = 2 To 10
ActiveCell.Offset(j, k).Value =
Application.WorksheetFunction.Correl(arrTop(, j), arrTop(, k))
Next k
Next j




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default using arrays to complete calcs

So Jim,

I tried to apply what Dana used below. Is it correct?

Thanks,
Matt

For j = 1 To 9
For k = 1 To 9
With Application.WorksheetFunction
ActiveCell.Offset(j + 1, k).Value =
..Correl(.Index(arrTop, 0, k), .Index(arrTop, 0, j))
End With
Next k
Next j

It doesn't seem to give the same values if I were to do it by hand.

Thanks,
Matt

"Jim Cone" wrote:


Dana DeLouis's response to your "simplify" post on 04/17/2009 answers this question too.
--
Jim Cone
Portland, Oregon USA




Matt S"

wrote in message
All,
I am trying to use a column of my 2-dimensional array in a worksheet
function. I unfortunately do not know how to do this. This is what I have
so far below (cut from certain portions). I am trying to use the
correllation function to compare the column data of arrTop to another column
data of arrTop. I'm thinking of making the columns I'm comparing ranges
first, then putting them in the correl function?
Thanks for any help,
Matt

ReDim arrTop(1 To LastRow, 1 To 11)
arrTop = ActiveCell.Offset(-ActiveCell.Row + 1, -12).Range("B" &
StartingRow & ":L" & EndingRow).Value

For j = 1 To 10
For k = 2 To 10
ActiveCell.Offset(j, k).Value =
Application.WorksheetFunction.Correl(arrTop(, j), arrTop(, k))
Next k
Next j





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default using arrays to complete calcs

ah nevermind... I am getting the same thing! GREAT THANK YOU!

"Matt S" wrote:

So Jim,

I tried to apply what Dana used below. Is it correct?

Thanks,
Matt

For j = 1 To 9
For k = 1 To 9
With Application.WorksheetFunction
ActiveCell.Offset(j + 1, k).Value =
.Correl(.Index(arrTop, 0, k), .Index(arrTop, 0, j))
End With
Next k
Next j

It doesn't seem to give the same values if I were to do it by hand.

Thanks,
Matt

"Jim Cone" wrote:


Dana DeLouis's response to your "simplify" post on 04/17/2009 answers this question too.
--
Jim Cone
Portland, Oregon USA




Matt S"

wrote in message
All,
I am trying to use a column of my 2-dimensional array in a worksheet
function. I unfortunately do not know how to do this. This is what I have
so far below (cut from certain portions). I am trying to use the
correllation function to compare the column data of arrTop to another column
data of arrTop. I'm thinking of making the columns I'm comparing ranges
first, then putting them in the correl function?
Thanks for any help,
Matt

ReDim arrTop(1 To LastRow, 1 To 11)
arrTop = ActiveCell.Offset(-ActiveCell.Row + 1, -12).Range("B" &
StartingRow & ":L" & EndingRow).Value

For j = 1 To 10
For k = 2 To 10
ActiveCell.Offset(j, k).Value =
Application.WorksheetFunction.Correl(arrTop(, j), arrTop(, k))
Next k
Next j





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default using arrays to complete calcs

Hi Matt,

try this:

with Application.WorksheetFunction
ActiveCell.Offset(j, k).Value = .Correl(.Index(arrTop, 0, j),
..Index(arrTop, 0, k))
End With

Not tested tough...

Hope this helps,
Dominik.



Matt S schrieb:
All,

I am trying to use a column of my 2-dimensional array in a worksheet
function. I unfortunately do not know how to do this. This is what I have
so far below (cut from certain portions). I am trying to use the
correllation function to compare the column data of arrTop to another column
data of arrTop. I'm thinking of making the columns I'm comparing ranges
first, then putting them in the correl function?

Thanks for any help,
Matt


ReDim arrTop(1 To LastRow, 1 To 11)
arrTop = ActiveCell.Offset(-ActiveCell.Row + 1, -12).Range("B" &
StartingRow & ":L" & EndingRow).Value

For j = 1 To 10
For k = 2 To 10
ActiveCell.Offset(j, k).Value =
Application.WorksheetFunction.Correl(arrTop(, j), arrTop(, k))
Next k
Next j




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
Percentage Calcs Muskoka83 Excel Discussion (Misc queries) 1 May 17th 10 11:35 PM
Averageif Calcs Help Excel Discussion (Misc queries) 6 August 21st 09 02:19 PM
What are the calcs in PMT Micky G Excel Worksheet Functions 7 November 22nd 07 07:31 PM
Arrays - declaration, adding values to arrays and calculation Maxi[_2_] Excel Programming 1 August 17th 06 04:13 PM
Time calcs srb Excel Discussion (Misc queries) 1 April 5th 06 07:04 AM


All times are GMT +1. The time now is 03:43 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"