Dynamically Change How Values Are Displayed In A Chart
Dec 23, 2013
Is it possible to dynamically change how values are displayed in charts?
I have a list which references different named ranges. It either needs to display the values in a graph as a number (without decimals) or a percentage depending on the source. Is this possible? Maybe with some VBA? Or am I asking too much from excel?
I maintain Production data in an Excel Sheet and have the code which will create Chart for each Employee. Sample Sheet Attached. However, I want the Chart Range to be updated in a Single Chart and exported to a .Gif File.
I've got an excel worksheet that contains charts 5-14, each with different max axes on primary and secondary scales. Right now the code below works to adjust the axes, however I have pasted this into a script 10 times, once for each chart with different references to the chart number, the max primary axis and max secondary axis. how I could write the following as a loop so that I don't need to have to repeat this routine in my code?
Sub ChartsBillingsShare() ActiveSheet.ChartObjects("Chart 5").Activate With ActiveChart .HasAxis(xlValue, xlPrimary) = True .HasAxis(xlValue, xlSecondary) = True End With ActiveChart.Axes(xlValue).Select With ActiveChart.Axes(xlValue) .MinimumScale = 0 .MaximumScale = Range("Y6").Value End With.................................
I had a question regarding pivot charts. Someone sent me an excel spreadsheet and i wanted to copy the pivot chart exactly but change the values. I just get the error that says "you cannot edit data in calculated fields" etc. I really just want to use the exact same set up but change a few numbers around.
I have calculated data (the column and row headings are calculated as well) similar to this for which I need to create an automatically updating chart.
The chart should update if the data is filtered; so if a user doesn't want to see the 'orange' row they can filter the data accordingly. There is a finite number of rows and columns in the range but sometimes there will be less data. I have tried to convert the data to a table and that works quite well except the legend keys persist: so if there is no data for pillows and stickers the legends still appear and have to be removed manually. Also, there seems to be a bug in Excel 2007 whereby the removal of a chart linked to table data causes a persistent error message to appear. I know that I need to created a named range for the data series using OFFSET, and I have also read that I need to refresh this formula using VBA but I am now very confused and none of my attempts quite work.
I have an expense sheet calculated, need to show the sum of the "+" number in a cell that does a subtraction of 2 numbers .. income and subsidized ... as a - that it negitave amount in red if it is less than a specific numbe. ie 2500
I need the marked line to be different from/to a point in time (x scale), depending on the backfill date in Rolling_window_data. All the contents are generated programmatically so the backfill date cell with a value will almost always be different. From what I've researched, I should make 2 series that overlap each other (in the current case, the 1st series should end on line 27 and the second should start from line 27 and continue to the end). The start is always line 3 and the end is always line 122.
How do I dynamically set the series start/end so I can make them overlap each other? I'm assuming I should add some kind of 'IF Statement' to the series code but I'm very new to excel formulas.
Code: =SERIES(Rolling_window_data!$B$2;Rolling_window_data!$A$3: IF(FOR Each Cell in Range("D3:D122") cell.value #N/A, Cell, "D122");Rolling_window_data!$B$3:$B$122;1)
See the attached example. I have data listed as shown, but need the chart to automatically update whenever a new sales figure is added to the next month. I know you have to use the OFFSET to create dynamic ranges but I can't get it to work horizontally, only if my data is laid out vertically.
Setting the XValues property gives an "Unable to set the XValues property of a series class".
Using the chart wizard, trying to set the category labels parameter of the chart wizard to a range doesn't give an error message, but does leave the category labels section of the chart (when I click and view it) blank.
After searching this board, I am using a check for this issue to alert when the problem occurs, but I'm hoping to tell Excel to fix the problem itself. The issue occurs when a set of data equals 100%, but when fewer decimals are displayed, the displayed total equals 101% or 99%.
Example: 0.6% 1.6% 97.8%
(Now when the display is changed to no decimal points) 1% 2% 98%
As you can see, the data appears to total 101%, and my boss is being a (insert any comment you probably have about your boss) about me not manually reviewing every single report that goes out for this 1% difference. As there are probably 400 different points at which this situation can occur on a daily basis, working harder is not the solution. /rant
I thought I once heard about a formula or setting where Excel will only calculate the displayed values instead of the actual value or formula. Ideally, the formula would know to take the three values, figure out the 100% limitation, and round the largest one down so the other two can round up. The example above is probably 99% applicable, as we would be rounding the largest value down in order to round the other values up.
Now i have to compile 3 years of data for 200 airports so changing the month and year for every airport would be a challenge. I can do Replace all and change the year and month but instead of that i was thinking if i could have the year and month on one row and connect the links to that cell so that whenever i drag the cell my link changes
I have used this code a number of times to automatically change the scale of x axes without problem. I have just used it however and it has condensed the data so that it the line only appears in the last quarter of the chart.
Code: Option Explicit
Sub ChangeStaticAxisScales() With Sheets("Static Charts").ChartObjects("Chart 2").Chart
' Value (Y) Axis With .Axes(xlValue) .MaximumScale = Worksheets("Raw Data").Range("AN7").Value .MinimumScale = Worksheets("Raw Data").Range("AN6").Value .MajorUnit = Worksheets("Raw Data").Range("AN8").Value End With
I am using the STDEV function on a range of values: STDEV($I$26:I2545). My starting cell is constant and I would like to make my ending cell variable based on a value I enter in a master cell (A1). The value I enter in the master cell is multiplied by 252 the product would equal the row number I would like to stop at. So if I enter 1 the formula will be STDEV($I$26:I252). I tried: STDEV($I$26"I"&(A1*252))) and other such variations to no avail
Need assistance with this code provided by SHG. See attached sample. I need to create a range called DaysOff so that this function will work. As it is the function is perfect; though the accuracy if the result is dependent on the exact range, thus I need this named range to be dynamic. I have tried but it does not seem to work correctly. The named range should refer to the list of names between 1-10. The range should dynamically include any names that are listed.
Public DaysOff As Range Function datNext(datLast As Date, DaysOff As Range) As Date Dim datBeg As Date, datEnd As Date Dim iLastPd As Integer Dim iDay As Long, nDay As Long Dim iYr As Integer, iMo As Integer iYr = Year(datLast) iMo = Month(datLast) datBeg = DateSerial(iYr, iMo + 1, 1) datEnd = DateSerial(iYr, iMo + 2, 0) iLastPd = Pd(datLast) nDay = DaysOff.Rows.Count Do.......................................
I am trying to add a vertical line dynamically to a chart. What I mean is I have a chart that will have a line type chart on it and I want to add a vertical line to it based on the output of one cell in that same workbook. I am making this workbook for use by end-users so I can't ask the end-users to make a bunch of modifications to the sheet or or chart. What I do has to just work when they use the workbook.
The line chart has an X axis of time and a Y axis of items sorted. (This is the part of the chart I have done already.) I want to add a vertical line fed from a cell which will have a time fed from a cell on the workbook. For example the line chart goes from 9:00 to 16:00 and the vertical line might be at 13:00. The cell feeding the vertical line is subject to change based on the other inputs on the workbook so that's why I say the vertical line has to be dynamic as the vertical line could be anywhere between 9:00 to 16:00 or it might even be that I can't place the vertical line because the feeding cell is outside the range of 9:00 to 16:00.
I have seen a number of ways to do this but none that are dynamic and automatic and don't require end user to adjust the workbook to make the vertical line at the correct on the time scale.
For a form that dynamically creates a series of text boxes and labels, does anyone know how to change the caption of a dynamically created label to display the value of a cell in a worksheet? The cell in the worksheet changes according to input on the text boxes. In the form's code, I have:
Dim newLblFreq As MSForms.Label Set newLblFreq = Me.Controls.Add("Forms.Label.1", "lblfreq" & i, True) newLblFreq.Caption = Range("V" & i).Text & " Hz"
But once the label is created, the caption won't change, even if Range("V" & i) changes...............
I have a pivot table that summarises data from a timesheet. The summary looks something like the following and shows the number of 15 minutes intervals spent on a range of categories and jobs:
How can I have this pivot table display the number of minutes instead of the number of intervals (i.e. it needs to take the value displayed currently and multiple it by 15). I'm sure there must be some simple way to achieve this but can't figure it out (I don't want to use vba).
I'm currently working on a test matrix that has high level and mid level test cases. The High level results cell is tracking all mid level test cases below it. If all mid level test cases are displayed as "Pass" then the High level test cases displays "PASS". If any of the mid level test cases is not displayed as "PASS" then the High level test case result is displayed as "FAIL" However, "PASS" and "FAIL" do not accurately represent the status of the test cases in the instance of them not being filled out. Mid Level test cases start off in the "Select Result" state which basically says it that test has not been performed. I would like to have a third value displayed as "NOT COMPLETED" or "IN PROGRESS". Below is the current formula that I am using.
On thing to keep in mind that may or may not make a difference is that one of the High level test cases has 30 mid level test cases and from my understanding, IF / AND function only allows up to 30 logic inputs (not sure if that is the correct terminology or correct at all).
I've got the following formula in a column: =IF(C10/B10>=1,20,IF(ISERR(C10/B10),0,0)). The purpose is to ensure that only one of two values (20 or 0) is displayed, regardless of circumstances that regularly generate the # DIV/0 error. The if(iserr(...)) part works fine when tested on its own, but when nested, it's still allowing the error to display.
I have the following vlookup formula in my spreadsheet.
IF(ISNA(VLOOKUP($A2,'Purchase Order Pivot Table'!$5:$500,67,FALSE)),0,VLOOKUP($A2,'Purchase Order Pivot Table'!$5:$500,67,FALSE))
It works perfectly for my current requirement, but it looks at data in a pivot table which is created from a dataset. If I name the columns in the pivot table so instead of looking at column 67 it looks at a name range will this name range change dynamically when the pivot table is refreshed? If not how can I get it to.
1. Data (Let's say 5 fruit names are entered) will be entered in sheet1 (row wise) 2. Data (Let's say 5 flowers names are entered) will be entered in sheet2 (row wise) 2. Entered data in sheet1 and sheet2 should get automatically populated in sheet3 under respective headers (header 1 - fruits and header 2 - flowers)
Rules : 1. We will have Headers with one default empty row 2. With addition of every row in sheet1 or sheet2, a row should automatically inserted in sheet3 under respective headers and populate data.
I want to use a macro to change attributes of a series in a chart. Unbelievably, if the series has been pasted into the chart from another chart, and although the macro can address the series and even return values (eg name) correctly, the selection simply cycles to one of the original series on the chart.
How can I add missing values to the axis in a pivot chart line chart? I have a numerical X-axis with values such as 0,1,5,8,14, etc. I have another set of Y values that correspond to the X values. If this was an XY-scatter plot I'd be able to plot X vs. Y and connect the dots for "gaps" in the X values. Since it's a pivot chart I cannot use an XY-scatter plot, I can only use a line chart. The line chart doesn't give me the ability to add the "missing" values, so it gives the impression that my data is more closely packed than it is. The data source is external to my spreadsheet, so I cannot add the values before creating the pivot table/chart.