# Need some help wih a Correlation formula

#### Dave L

##### Board Regular
I have the following formula which calculates the median for D6:D671 if certain conditions are met:

Median(IF((\$B\$6:INDIRECT("B"&\$C\$703)<=\$F721)*(\$B\$6:INDIRECT("B"&\$C\$703)>\$G721),D\$6:D\$671))

What I would like to do is calculate the correlation between D\$6:D\$671 and another range E\$6:E\$671 if those same conditions are met, but I can't figure out the necessary changes to the formula to use the CORREL function.

Can anyone help me out on this?

Thanks,

Dave

### Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

#### fairwinds

##### MrExcel MVP
Hi,

Try:

=CORREL(IF((\$B\$6:INDEX(B:B,\$C\$703)<=\$F721)*(\$B\$6:INDEX(B:B,\$C\$703)>\$G721),D\$6:INDEX(D:D,\$C\$703)),IF((\$B\$6:INDEX(B:B,\$C\$703)<=\$F721)*(\$B\$6:INDEX(B:B,\$C\$703)>\$G721),E\$6:INDEX(E:E,\$C\$703)))

Confirmed with Ctrl + shift + enter.

#### Dave L

##### Board Regular
fairwinds,

Thanks for your help. I didn't use your formula exactly because I had made some changes to what I was doing, but your suggestion helped me get it all straight and working properly.

Thanks again,

Dave

Replies
5
Views
241
Replies
3
Views
143
Replies
1
Views
69
Replies
1
Views
77
Replies
1
Views
169

1,195,835
Messages
6,011,880
Members
441,651
Latest member
drewe2000

### 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?

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