Correlation if between two dates

tjkramer

New Member
Joined
Aug 11, 2018
Messages
16
Office Version
  1. 2013
Platform
  1. Windows
Hi,

Column A =daily dates (dd/mm/yyyy) for 10 years
Column B = daily natural gas prices
Column C = daily power prices
Cell D1 = Start Date
Cell D2 = Stop Date

Would like to compute correlation between power and gas for dates that fall between my Start Date and Stop Date.
Need to be able to change Start and Stop Dates to see how correlation changes

Something along the lines of a "SumIfs" function but with a "Correlifs" -- Correlifs(power,Gas, Start Date >= D1, Stop Date <=D2)

Thanks in advance for the help!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi tjkramer,

Try using the following formula:
Code:
=CORREL(INDEX($B:$B,MATCH($D$1,$A:$A,0)):INDEX($B:$B,MATCH($D$2,$A:$A,0)),INDEX($C:$C,MATCH($D$1,$A:$A,0)):INDEX($C:$C,MATCH($D$2,$A:$A,0)))

INDEX+MATCH formulas will identify the correct data ranges for you.
 
Last edited:
Upvote 0
Worked like a charm!
Many many many thanks for the quick help and precise, easy to understand answer!
You saved me a ton of time (and prevented a ton of errors)
 
Upvote 0
:) I'm very glad to hear it! Thanks & take care.
 
Upvote 0

Forum statistics

Threads
1,215,522
Messages
6,125,312
Members
449,218
Latest member
Excel Master

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