Complex Offset formula

Matt_Thompson

Board Regular
Joined
Apr 5, 2004
Messages
101
Hi,

I hope someone can help or at least put me in the right direction.

I have 3 offset formula's which I need to combine. This in itself shouldn't be a problem (I don't think!) but to make this a bit more complex, I have been told that the result of the offsets need to be capped at 20%+/-.

The 3 offsets are:
=SUM(I10:OFFSET(I10,0,$BQ$1-2))/SUM(I2:OFFSET(I2,0,$BQ$1-2))
divided by
=SUM(U10:OFFSET(U10,0,$BQ$1-2))/SUM(U2:OFFSET(U2,0,$BQ$1-2))
multiply
=OFFSET(I10,0,$BQ$1-1)

In the offsets I10 is this years monthly figures and $BQ$1 is the offset that is showing the current period.
I2 is the number of calendar days for that month.
U10 is last years monthly figures and the last offset is showing what the current Period figure is.

If I put all 3 formulae together, how would I then cap the outcome at between +20% and -20%?

Thanks in advance,

Matt
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I've managed to do the formula so here it is for anyone who might find this useful:

=IF(SUM(SUM(I10:OFFSET(I10,0,$BQ$1-2))/SUM(I2:OFFSET(I2,0,$BQ$1-2))/SUM(U10:OFFSET(U10,0,$BQ$1-2))/SUM(U2:OFFSET(U2,0,$BQ$1-2))*SUM(OFFSET(I10,0,$BQ$1-1))/100)>20,20,AND(IF(SUM(SUM(I10:OFFSET(I10,0,$BQ$1-2))/SUM(I2:OFFSET(I2,0,$BQ$1-2))/SUM(U10:OFFSET(U10,0,$BQ$1-2))/SUM(U2:OFFSET(U2,0,$BQ$1-2))*SUM(OFFSET(I10,0,$BQ$1-1))/100)>-20,-20,(SUM(SUM(I10:OFFSET(I10,0,$BQ$1-2))/SUM(I2:OFFSET(I2,0,$BQ$1-2))/SUM(U10:OFFSET(U10,0,$BQ$1-2))/SUM(U2:OFFSET(U2,0,$BQ$1-2))*SUM(OFFSET(I10,0,$BQ$1-1))/100)))))

Where RED is saying if the offset formulae is greater than 20 put 20
BLUE is the same as above but for -20
Green is the else past of the if statement ie, if the first two criteria are false then follow this formula.

It's pretty crude and I'm sure it can be done much better than this but if this helps then feel free to use it or if anyone wants to know any more about this then PM me or mail me.

Thanks,

Matt
 
Upvote 0
Try...

=MEDIAN(-0.2,YourFormulaHere,0.2)

Hope this helps!
 
Upvote 0
Hi Dominic,

I tried that but it doesn't work. This is the formula I put into excel:

=MEDIAN(-0.2,(SUM(SUM(I10:OFFSET(I10,0,$BQ$1-2))/SUM(I2:OFFSET(I2,0,$BQ$1-2))/SUM(U10:OFFSET(U10,0,$BQ$1-2))/SUM(U2:OFFSET(U2,0,$BQ$1-2))*SUM(OFFSET(I10,0,$BQ$1-1))/100),0.2)

Am I doing something wrong?

Thanks,

Matt
 
Upvote 0
Apologies Dominic,

I have got it working now. Sorry!

Here is the formula:

=MEDIAN(-0.2,(SUM(I10:OFFSET(I10,0,$BQ$1-2))/SUM(I2:OFFSET(I2,0,$BQ$1-2))/SUM(U10:OFFSET(U10,0,$BQ$1-2))/SUM(U2:OFFSET(U2,0,$BQ$1-2))*SUM(OFFSET(I10,0,$BQ$1-1))/100),0.2)*100

Thanks for your help!,

Matt
 
Upvote 0

Forum statistics

Threads
1,222,071
Messages
6,163,741
Members
451,855
Latest member
mcook36155

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