Consulting

Results 1 to 4 of 4

Thread: Convert a value to suit an Excel Speedo's segmented variable scale

  1. #1
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location

    Convert a value to suit an Excel Speedo's segmented variable scale

    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.
    Attached Files Attached Files

  2. #2
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location
    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.
    Attached Files Attached Files

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    =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,"")))))))))),"")
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location

    Thumbs up

    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)
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •