Calculate running percentage change highs and lows every five days

xeven_

Active Member
Joined
Jan 20, 2012
Messages
302
I have data in coulmns C and D. I want to calculate the percent difference between th ehighest and lowest valueevery five days and have that value populate in the adjacent column/cell E. Is there a formula to help me do this? As in this example the percent change form the highest vale 8.2 to the lowest 6.62 is -19%. I was hoping to get a formula that can populate in E and scroll down to keep a running analysis of every five days. This is daily data with a weekly hopefully relevent metric.

Monday, April 2, 201211%8.27.4
4/3/20124%7.87.5
4/4/20126%7.777.31
4/5/20122%7.557.37
4/9/201219%7.896.62 -19%

<colgroup><col><col span="4"></colgroup><tbody>
</tbody>
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi,

Below formula applied from Friday and below should work:

=IF(TEXT(A6,"dddd")="Friday",SMALL(D2:D6,1)/LARGE(C2:C6,1)-1,"")

This is shown below:

ABCDE
1Day%MaxMinRunning %
26/17/201911%8.27.4
36/18/20194%7.87.5
46/19/20196%7.777.31
56/20/20192%7.557.37
66/21/201919%7.896.62-19%
76/22/201913%8.937.93
86/23/201921%7.616.29
96/24/201935%8.386.2
106/25/20193%6.636.44
116/26/201918%7.166.07
126/27/201931%8.036.11
136/28/201925%8.686.96-30%
146/29/201913%8.927.86
156/30/20191%6.136.06

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet4

Worksheet Formulas
CellFormula
B2=C2/D2-1
B3=C3/D3-1
B4=C4/D4-1
B5=C5/D5-1
B6=C6/D6-1
B7=C7/D7-1
B8=C8/D8-1
B9=C9/D9-1
B10=C10/D10-1
B11=C11/D11-1
B12=C12/D12-1
B13=C13/D13-1
B14=C14/D14-1
B15=C15/D15-1
E6=IF(TEXT(A6,"dddd")="Friday",SMALL(D2:D6,1)/LARGE(C2:C6,1)-1,"")
E7=IF(TEXT(A7,"dddd")="Friday",SMALL(D3:D7,1)/LARGE(C3:C7,1)-1,"")
E8=IF(TEXT(A8,"dddd")="Friday",SMALL(D4:D8,1)/LARGE(C4:C8,1)-1,"")
E9=IF(TEXT(A9,"dddd")="Friday",SMALL(D5:D9,1)/LARGE(C5:C9,1)-1,"")
E10=IF(TEXT(A10,"dddd")="Friday",SMALL(D6:D10,1)/LARGE(C6:C10,1)-1,"")
E11=IF(TEXT(A11,"dddd")="Friday",SMALL(D7:D11,1)/LARGE(C7:C11,1)-1,"")
E12=IF(TEXT(A12,"dddd")="Friday",SMALL(D8:D12,1)/LARGE(C8:C12,1)-1,"")
E13=IF(TEXT(A13,"dddd")="Friday",SMALL(D9:D13,1)/LARGE(C9:C13,1)-1,"")
E14=IF(TEXT(A14,"dddd")="Friday",SMALL(D10:D14,1)/LARGE(C10:C14,1)-1,"")
E15=IF(TEXT(A15,"dddd")="Friday",SMALL(D11:D15,1)/LARGE(C11:C15,1)-1,"")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Awesome! Hey if the higher value such as 8.2 on 6/17/19 came first and the lower value 6.62 later can it be made to reflect a decrease (negative % change) instead of positive? Trying to line graph it isn't working to well with the negative numbers
 
Last edited:
Upvote 0
This is what I have which is pretty close. The only thing is my excel 2016 doesnt want to graph negative values. Perhaps I can reverse the large and small in the code to change the values to positive number but then the actual data string will be false as when working with percents the value is different when going from the higher number to the lowerthan it is when going from lower to higher.. sigh.....

Friday, March 30, 201217%8.247.06
Monday, April 2, 201211%8.27.4
4/3/20124%7.87.5
4/4/20126%7.777.31
Thursday, April 5, 20122%7.557.37
Monday, April 9, 201219%7.896.62
4/10/20124%7.236.97
4/11/20128%7.537
4/12/20127%7.567.08
Friday, April 13, 201210%7.697-16%
Monday, April 16, 20126%7.166.73
4/17/20125%7.156.8
4/18/20127%7.36.82
4/19/20124%7.297
Friday, April 20, 20122%7.197.02-8%

<colgroup><col><col span="3"><col></colgroup><tbody>
</tbody>
 
Upvote 0
Think I got it. I played with it a bit and modified it to: =IF(TEXT(A6,"dddd")="Friday",LARGE(D2:D6,1)/SMALL(C2:C6,1)-1,"")
This gives me the positive values in E and makes it where the chart and illustrate it visually. The higher to lower or lower to higher difference is likely still an issue but as I am mainly looking for major abnormalities it may not affect it too much.

Thanks again :p
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

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