Add data points to Excel stacked bar chart - excel

I have a table with salary ranges for various titles and individual salaries (see below).
Data:
What I'd like to do, is to create a stacked bar (or column) chart in MS Excel (Office 365 ProPlus) which shows the ranges, as well as the individual salaries with employee names as data markers. Please note that the number of employees is not the same for each title, e.g. there are 2 clowns, but 3 jugglers and so on.
Here is what I'd like to achieve. I have manually added a couple of data markers for illustration by editing the image:
Desired chart:

With your horizontal bar chart already in place make sure it is a stacked horizontal chart, then create the data for the blue dots like in the table of my screenshot. Select B12 to C19 and copy. Then select the chart and use Paste Special. Paste with these options selected and all others unticked
new series
values in columns
Categories (X Labels) in First column
That will stack bars onto the existing chart. Select the stacked series and change the series chart type to Scatter chart.
The row position and the salary column are in the wrong order for our purpose. Using copy and paste, paste the row position into column D, then copy C11 to D19 and paste to B11.
Then add data labels with the option "Values from cells" and select A12 to A19.
Adjust the salary values and the formatting of the dots.

Related

How to Format Tablix column alignment when tablix column from Multi column selection

I have one problem, I have one powerBI report on which I want one tablix and require one slicer where I can have number of columns, when user select the column from this slicer then that column need to add in tablix and after unselect column from slicer, this column need to remove from tablix. till this step I have completed, but when column is added from this slicer, that column not formatted, means, all columns alignment by default set to left only.
so, If I want to change one column alignment as Right then this will not work,
I want text column to align to be on left and number columns alignment to be on right.
so please help.
need help on formatting matrix table columns in powerBI. try to format column but not done.

How to hide a specific row of Excel chart data table?

So right now I have a chart with 3 series, which will have 3 rows of data in the chart's data table. If I want to hide the last row in the data table, but keep the series in the chart, how can it be done? The only way I can think of is to create a block to cover that part, but is there a better way of doing it?
Edit: I'm looking for a way to show the series in chart, but not in chart data table.
Select the last row of chart data and format the cell's displayed text/number as ;;;. If the chart data is dynamic, then the last row can be identified with something like,
=row()=match(1e99, A:A)
This would enable you to create a conditional formatting rule that applies the ;;; cell number format to the last row.
Expanding on my comment to your question.
You could:
Make a new table on the worksheet that points, via formulas, to the range that the chart is made from.
In those formulas, use if() statements to toggle the values on/off based on whatever logic you are using to hide/show. Below I use a checkbox.
Remove the data table from your chart
Make the background of your chart area "No Fill" so it's transparent.
Line your chart x-series up with the formula based table so it looks like the data table for your chart
You can just make changes in the graphs.
Select the line graph series that you do not want to display in the chart.
Right click and click on "Format Data Series"
Click on "Fill & Line" (an icon of a paint)
Select "No Line"

How do I update the data label of a chart?

For example, I have a pie chart, 95% of it is blue.
Now I update some excel fields that have to do with the blue area of the piechart, 95% then goes down to 90%.
Now I want to also update the Data label of the blue area because it is still 95% and not 90%, instead of changing it manually, how can I make excel update the labels for me?
First, you have to build the labels via formula somewhere on a worksheet. Once you've done that, you can link the chart's labels to the cell containing the "data labels"
To build your data labels, somewhere else on your worksheet (conveniently, in the adjacent column would be ideal), use Excel formula to build the desired label string, for example: ="Blue occupies "&TEXT(B3,"0%")
Repeat for the other points in the chart.
Once you've done that, here's how you link Data Labels to a cell reference (normally, Data Labels are linked to the underlying data value).
Select the data label
Then, place your cursor in Excel's Formula Bar, and enter the formula like ='Sheet2'!$C$3.
Now, that data label is associated by the formula, to the cell C3, which contains the desired data label that we built above. Repeat as needed.
Note: The sheet name is required in this formula. Use single-quotes around the sheet name if it contains spaces.

Prevent re-sizing of charts when column and row dimensions are changed

I have plotted many charts on a sheet. The chart dimensions are fixed mentioning the chart should be how many rows and columns wide.
The charts are plotted with these dimensions; but if the column width or row width is changed, then the chart dimensions increase accordingly. I want a code which will not resize the chart on further changes with the column and row dimension changes once the charts have been plotted according to original row and column dimensions.
You need to set the charts to Free Floating, so they do not resize in response to row and column changes.
ActiveSheet.Shapes("YourChartName").Placement = xlFreeFloating
Do this for each of the charts.
You can also do the same, manually, without VBA. Right-click a chart and select Format Chart Options. Then, under Properties, select "Don't move or size with cells."

Trendline conditional formatting

I wasn't successful in finding a solution to my question by googling it, so i hope here there are experts that can help.
I just have one set of data over time (the number of actions per date, so for one month, two columns and 30 rows). I am using a clustered column chart to visualize that data, and have placed a trendline on it.
I would like to change the color of the trendline dynamicaly, to RED if it it descending, or GREEN if ascending. That's it.
Whatever option I tried in Excel 2013, I haven't found the solution, and programmaticaly, I am too "dummy".
I have an approach that skips the built-in trendline. You calculate your own slope, intercept, and correlation, plot your own trendline(s), and use your own formula in the chart. In fact, you have two lines to go with your columns, one that appears if the slope is positive and the other if the slope is negative.
Here's how:
In the screenshot above I have your data in columns A and B. I calculate some statistics as follows:
cell G2: =SLOPE(B2:B12,ROW(B2:B12))
cell G3: =INTERCEPT(B2:B12,ROW(B2:B12))
cell G4: =CORREL(B2:B12,ROW(B2:B12))
I generate the formula in cell G6:
="Y = "&TEXT(G3,"0.0000")&" + "&TEXT(G2,"0.0000")&" * X"&CHAR(10)&"R² = "&TEXT(G4^2,"0.0000")
The superscript "²" is inserted by holding Alt while typing 0178 on the numeric keypad. "0.0000" is the format I'm using to display the cell values in the formula; without using the TEXT function, you'll get something with way too many digits to be useful.
The formulas in C2 and D2 (copied down the column as needed) are:
cell C2: =IF($G$2>0,$G$3+$G$2*ROW(),NA())
cell D2: =IF($G$2<0,$G$3+$G$2*ROW(),NA())
Because of the IF and the NA(), you get values only in one column and #N/A errors (which won't plot in a line chart) in the other, depending on slope.
Create a clustered column chart using all four columns, then change the chart type of the two trend series to line chart. Format the columns and lines as desired.
Select the title by its border, so the cursor isn't in the text of the title. Type =, then click on the cell with the formula. This link will cause the title to update if the formula changes. Change the title text size from huge to something reasonable.
Delete the legend if desired. In this case it really isn't needed.

Resources