PDA

View Full Version : Convert a value to suit an Excel Speedo's segmented variable scale



RINCONPAUL
04-18-2016, 05:52 PM
In the attachment I've built a linear speedometer. Cell B16 has a constantly updating feed of price values between 0 and 1000 (type a value in B16 and the needle will move). The 180 deg arc is divided into 10 equal segments, however they don't represent 10% of the scale. The scale is not logarithmic in the sense that a value within a segment of the pie, let's say the value $5 is halfway (50%) between $4 and $6 on the speedo increments. However the speedo increments have a wider value range, each segment.

At the moment the needle is at $2.5 as if the fraction was 2.5/100, but it's showing a value less than $1 on the speedo. I need a formula that converts the input value to a relative % of the applicable segments.

Background: These segments represent Betfair tick sizes. System formula has been devised around a price being within a certain tick size segment at the close of betting, however as the starting price is never really known till after the close, a price hovering close to the border between two tick size segments, could go either way and ruin the system premise, so a bet to avoid possibly. Being able to see when the speedo needle is hovering close to a changeover, would be handy to know at a glance?

Thanks, as always.

RINCONPAUL
04-19-2016, 03:27 AM
I ended up solving it, but it required this formula:

=IF(AND(E24>=0,E24<=2),(((E24)/2)*10),(IF(AND(E24>=2,E24<=3),((((E24-2)/1)*10)+10),(IF(AND(E24>=3,E24<=4),((((E24-3)/1)*10)+20),(IF(AND(E24>=4,E24<=6),((((E24-4)/2)*10)+30),(IF(AND(E24>=6,E24<=10),((((E24-6)/4)*10)+40),(IF(AND(E24>=10,E24<=20),((((E24-10)/10)*10)+50),(IF(AND(E24>=20,E24<=30),((((E24-20)/10)*10)+60),(IF(AND(E24>=30,E24<=50),((((E24-30)/20)*10)+70),(IF(AND(E24>=50,E24<=100),((((E24-50)/50)*10)+80),(IF(AND(E24>=100,E24<=1000),((((E24-100)/900)*10)+90),""))))))))))))))

The value input cell moves to E24, see amended attachment. Is there a way to streamline this long formula?
Thanks.

Bob Phillips
04-19-2016, 05:14 AM
=IF(E24>=0,IF(E24<=2,(E24/2)*10,
IF(E24<=3,(E24-2)*10+10,
IF(E24<=4,(E24-3)*10+20,
IF(E24<=6,(E24-4)/2*10+30,
IF(E24<=10,(E24-6)/4*10+40,
IF(E24<=20,(E24-10)/10*10+50,
IF(E24<=30,(E24-20)/10*10+60,
IF(E24<=50,(E24-30)/20*10+70,
IF(E24<=100,(E24-50)/50*10+80,
IF(E24<=1000,(E24-100)/900*10+90,"")))))))))),"")

RINCONPAUL
04-19-2016, 12:28 PM
That's more streamlined, thanks xld. I got thinking about the new 'IFS' function in Ex2016, and thought this forum exercise might be a good opportunity to try it out? Use 'IFS' as a vlookup achieves the same with only a short string of formula. The lookup table does all the work. Not sure if it'll be any faster in the long run? :
=IFS(E24>100,D37,E24>50,D36,E24>30,D35,E24>20,D34,E24>10,D33,E24>6,D32,E24>4,D31,E24>3,D30,E24>2,D29,E24>0,D28)