Skipping Rows in Formula

Sheepdoug

New Member
Joined
Apr 18, 2016
Messages
2
I'm trying to run a Pearson Correlation [=pearson(array1,array2)] between two columns (e.g. A and B, rows 1-20) but wanted to skip a few rows in both columns (e.g. 11-15). When I try to write the equation, skipping the rows by holding ctrl+highlighting, the equation writes itself as:

=pearson(A1:A10,A16:A20,B1:B10,B16:B20)

Which is an invalid function, since there should be only 2 arrays separated by a comma.

Obviously, I could simply delete rows 11-15, and re-organize the worksheet - but does anyone know how to adjust the formula to correlate A1:A20, B1:B20 - while skipping a few rows (in both columns)?

Thanks!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
=PEARSON(IF((ROW(A1:A20) <= 10) + (ROW(A1:A20) >= 16), A1:A20, FALSE), B1:B20)

Confirmed with Ctrl+Shift+Enter.
 
Upvote 0
Nice,

Or if there is some value in an adjescent column to indicate which rows should be included or excluded.
Like only consider values in A1:B20 IF C1:C20 = "x" <- or whatever

=PEARSON(IF(C1:C20="x", A1:A20, FALSE), B1:B20)
 
Last edited:
Upvote 0
You're welcome.

I like Jonmo's suggestion better, because it moves the conditional to the sheet instead of embedded in the formula.

The ", False" could be removed from both of our formulas.
 
Upvote 0

Forum statistics

Threads
1,213,486
Messages
6,113,932
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top