Correlation of every n rows

%3CLINGO-SUB%20id%3D%22lingo-sub-2919827%22%20slang%3D%22en-US%22%3ECorrelation%20of%20every%20n%20rows%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2919827%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20data%20in%20two%20columns%2C%20and%20I%20need%20to%20calculate%20correlations%20of%20first%2012%20rows%20and%20the%20last%2012%20rows.%20In%20this%20example%2C%20I%20need%20to%20calculate%20the%20correlations%20between%20B4%3AB15%20and%20H4%3AH15%2C%20and%20B16%3AB27%20and%20H16%3AH27.%26nbsp%3B%3C%2FP%3E%3CP%3ELet's%20say%20I%20write%20the%20formula%20in%20cell%20K5.%20How%20should%20the%20formula%20be%20written%2C%20so%20that%20the%20first%20value%20is%20equal%20to%20correlation(B4%3AB15%2CH4%3AH15)%20and%20when%20dragged%20down%2C%20the%20second%20value%20is%20equal%20to%20correlation(B16%3AB27%2CH16%3AH27).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20the%20help.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2919827%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2919945%22%20slang%3D%22en-US%22%3ERe%3A%20Correlation%20of%20every%20n%20rows%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2919945%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1204977%22%20target%3D%22_blank%22%3E%40Janispetke10%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20K5%3A%3C%2FP%3E%0A%3CP%3E%3DCORREL(INDEX(B%3AB%2C12*(ROW(K5)-ROW(%24K%245))%2B4)%3AINDEX(B%3AB%2C12*(ROW(K5)-ROW(%24K%245))%2B15)%2CINDEX(H%3AH%2C12*(ROW(K5)-ROW(%24K%245))%2B4)%3AINDEX(H%3AH%2C12*(ROW(K5)-ROW(%24K%245))%2B15))%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I have data in two columns, and I need to calculate correlations of first 12 rows and the last 12 rows. In this example, I need to calculate the correlations between B4:B15 and H4:H15, and B16:B27 and H16:H27. 

Let's say I write the formula in cell K5. How should the formula be written, so that the first value is equal to correlation(B4:B15,H4:H15) and when dragged down, the second value is equal to correlation(B16:B27,H16:H27). 

 

Thank you for the help. 

 

1 Reply

@Janispetke10 

In K5:

=CORREL(INDEX(B:B,12*(ROW(K5)-ROW($K$5))+4):INDEX(B:B,12*(ROW(K5)-ROW($K$5))+15),INDEX(H:H,12*(ROW(K5)-ROW($K$5))+4):INDEX(H:H,12*(ROW(K5)-ROW($K$5))+15))