Spedometer Type Chart (Donut) - Help with Formula

rconverse

Well-known Member
Joined
Nov 29, 2007
Messages
1,185
I'm trying to duplicate a chart from this tutorial.

http://www.datapigtechnologies.com/flashfiles/gaugechart.html

I've got everything working, expcept I don't want the chart to start at 0% and end at 100%. I want the lowest part of the chart to be 90%. I can't get the pointer to work correctly. Here are the formulas.

E1 is the fill rate. So in this example, let's say that value is 93%.
H10 is the highest value on my chart. That's 100%.

H1 is what ends moving the slice or "pointer".
=MOD(270+180*E1/H10,360)

Around the "spedometer", I have five labels. However, instead of having (going clockwise) 0, 25%, 50%, 75%, 100%, I have 90%, 92.5%, 95%, 97.5%, 100%. The result of the equation above tells VBA (code below) where to move the slice to represent the correct value. Again though, it's not corresponding correctly with the labels I'm using.

Does anyone know a way I can change the formula to be more dynamic with the labels?

Rich (BB code):
Application.ScreenUpdating = False

ActiveSheet.ChartObjects("Chart 2").Activate

ActiveChart.ChartGroups(1).FirstSliceAngle = ActiveSheet.Range("H1")

Worksheets("sheet1").Activate

Range("A1").Select

Application.ScreenUpdating = True
Thanks,
Roger
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

rconverse

Well-known Member
Joined
Nov 29, 2007
Messages
1,185
A challenge to the MVPs of the board? I say no one can solve this. No one is smart enough.

(*end reverse psychology*) :)
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,562
Messages
5,512,075
Members
408,878
Latest member
stams

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top