A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
That works! Wow. That is amazingly helpful.
Please, mighty excel wizard, explain to me exactly how you are using the OFFSET function.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This is Sheet1
| A | B | C | D | |
|---|---|---|---|---|
| 1 | 4 | 3 | 2 | 1 |
| 2 | 1 | 4 | 3 | 2 |
| 3 | 2 | 1 | 4 | 3 |
| 4 | 3 | 2 | 1 | 4 |
This is Sheet2
| A | B | C | D | |
|---|---|---|---|---|
| 1 | =PEARSON(Sheet1!A1:A4,Sheet1!A1:A4) | =PEARSON(Sheet1!A1:A4,Sheet1!B1:B4) | =PEARSON(Sheet1!A1:A4,Sheet1!C1:C4) | |
| 2 | =PEARSON(Sheet1!B1:B4,Sheet1!A1:A4) | |||
| 3 | =PEARSON(Sheet1!C1:C4,Sheet1!A1:A4) | |||
| 4 |
The question is how can I fill up this matrix by using the drag ability for formula so that I only have to write one block (e.g. A1 in Sheet2) =PEARSON(Sheet1!A1:A4,Sheet1!A1:A4). I have tried OFFSET and INDEX, but those are both confusing and the solutions I found from various forums did not work for me.
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
That works! Wow. That is amazingly helpful.
Please, mighty excel wizard, explain to me exactly how you are using the OFFSET function.
Assuming there are 73 observations of 300 variables, enter into A1
=CORREL(OFFSET(Sheet1!$A$1,0,COLUMNS($A$1:A1)-1,73),OFFSET(Sheet1!$A$1,0,ROWS($A$1:A1)-1,73))
Replace the two instances of 73 with the number of observations for your data set.
Drag down to A300.
With A1:A300 selected, drag across 300 columns to column KN.
Have you tried using the Correlation tool of the Analysis ToolPak?
Choose Data (ribbon) > Data Analysis > Correlation ...
I don't mean to be rude, but I will be blunt. That isn't exactly helpful. I want to be able to drag down to get the input you suggest, and then drag across. My actually data set is ~300 columns. I do not want to do that manually...
Here's a possible partial solution:
Enter the following formulas in the leftmost column.
=PEARSON($A$1:$A$4,A$1:A$4)
=PEARSON($B$1:$B$4,A$1:A$4)
=PEARSON($C$1:$C$4,A$1:A$4)
=PEARSON($D$1:$D$4,A$1:A$4)
Select the four cells containing the formulas, and then drag the fill handle in the bottom right corner to the right.
When I entered the four formulas into cells A6:A9 and copied them to columns BCD, I got: