Data bounded by high/low that resets when threshold exceeded

quantmaven

New Member
Joined
May 16, 2018
Messages
11
Hi,
How can I make a more intelligent formula that does this:
If any data in the previous row is out of the boundaries, data in next row (yellow) resets back to its threshold? I made an example with two columns that work but it's poorly written and it would become a nightmare with many columns. I feel an array must be used but I'm not sure how to do it. Thanks!

Reset_Value.xlsx
ABC
1RESET VALUE50%50%
2HI BOUND60%60%
3LO BOUND40%40%
4
5DATEABCXYZ
62012-12-3161.0%39.0%
72013-01-3150.0%50.0%
Sheet1
Cell Formulas
RangeFormula
C6C6=1-B6
B7:C7B7=IF(OR($B6>$B$2,$B6<$B$3,$C6>$C$2,$C6<$C$3),B1,B6)
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I think this is what you're after - all four columns reset because column E is outside its Hi Bound?

ABCDE
1RESET VALUE50%50%40%60%
2HI BOUND60%60%55%65%
3LO BOUND40%40%25%55%
4
5
660%41%50%66%
7Excel36550%50%40%60%
8Earlier versions50%50%40%60%
Sheet9
Cell Formulas
RangeFormula
B7:E7B7=IF(AND(B6:E6<=B2:E2,B6:E6>=B3:E3),B6:E6,B1:E1)
B8:E8B8=IF(AND($B6:$E6<=$B2:$E2,$B6:$E6>=$B3:$E3),B6,B1)
Dynamic array formulas.
 
Upvote 0
For the two asset portfolio rebalance you've shown, we can simplify the formula as follows (If one is overweight, the other must be correspondingly underweight and vice versa). The anomalous return highlighted is just to illustrate:

ABCDEFGHIJ
1ValuesReturns5%50%50%
2LO45%45%
3DateUSLINTDateUSLINTHI55%55%
431/12/2012623.2967.731/12/20120.0%0.0%31/12/201250.0%50.0%31/12/2012
531/01/2013656.91010.731/01/20135.4%4.5%31/01/201350.2%49.8%31/01/2013
628/02/2013660.71040.728/02/20130.6%3.0%28/02/201349.6%50.4%28/02/2013
728/03/2013690.61072.528/03/20134.5%3.1%28/03/201350.0%50.0%28/03/2013
830/04/2013714.31087.430/04/20133.4%-20.0%30/04/201355.0%45.0%30/04/2013
931/05/2013730.31151.831/05/20132.2%5.9%31/05/201354.1%45.9%31/05/2013
1028/06/2013734.21138.528/06/20130.5%-1.2%28/06/201354.5%45.5%28/06/2013
1131/07/2013757.71209.631/07/20133.2%6.3%31/07/201353.8%46.2%31/07/2013
12
Sheet1
Cell Formulas
RangeFormula
H2:I2H2=H1-$G$1
H3:I3H3=H1+$G$1
G4:G11,J4:J11G4=D4
H4:I4H4=H1
H5:I11H5=MEDIAN(H$2,H$3,H4*(1+E5)/(SUMPRODUCT($H4:$I4,1+$E5:$F5)))
F5:F7,E9:F11,E5:E8F5=C5/C4-1

But how do you want to generalise this? In the example below, will you reset all three assets (option A) or take the Option B minimal approach. What if there were 10 assets? Do you rebalance all assets (with associated transaction costs) every time one gets out of its permitted range?

ABC
Permitted range45-6530-500-10
Neutral55405
Actual602515
Options:
A) Reset55405
B) Buy B, sell C60355
 
Upvote 0
I made it two assets to simplify the basic formula but you make an interesting point about transactions costs if it is a full reset. Yeah it is smarter with your B) option.

Would you be down to do check this out with me and I paypal/xoom you some money for the time? I need to find a solution to my spreadsheet of like 7 assets. Thanks

Send me an email at quantmaven@gmail.com
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,831
Members
449,051
Latest member
excelquestion515

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