Excel: labels on a scatter chart, read from array - excel

Here I have a chart
I did a right-click -> "Add labels" , and it read them from my a(H/C) row. Basically, I want it to read label values from the CO2/CH4 row instead, so they would be 0,0.5,1,2,5,10 instead. Of course, I want the chart itself to remain the same, so, the x values of dots are in row "b(O/C)", their y values are in "a(H/C)" row, and their respective labels are read from "CO2/CH4". Can it be done automatically and how (preferrably, without scripting magic)? Rewriting them manually is a pain, really.

You will get the desired results by following the steps below:
Step 1: Click on the Chart
Step 2: Select the Design Tab in Ribbon Bar (Note: “Design Tab” appears only when the Chart is selected)
Step 3: Click on “Select Data” feature in the Design Tab as shown in Screen Shot 1
Step 4: Click on Edit Button as shown in Screen Shot 2
Step 5: Change the Series Name Rage and the data range in “Series Y Values:” as highlighted in Screen shot 3

What about adding the different points as different series and using the series names as labels (instead of the y-values) ?
If you need the "line" between the points (or if you need to add a trendline...), keep the serie you already have (with every point) without labels

Excel 2013 added the capability to use text from worksheet cells as data point labels. If you don't have 2013 (your screen shot looks like 2010), or even if you do, you can use Rob Bovey's free Chart Labeler add-in

Related

Excel - Change bar graph to all same colour

I have a bar graph as seen below, I need to change the colour of all the bars to let's say green.
Currently the only way I have been able to find to do this is click each individual date and then the fill bucket green as excel doesn't allow you to CTRL + Click multiple elements. Is there a way to change the colour of all the bars shown in one go?
Worth mentioning I can not change the colours by creating a "values table" as the workbook is locked and I have to do this for several different graphs.
That's happening because you have created the chart using every date as an individual serie. I suggest to use the "Switch Row/Column" option and became all the dates as a unique serie, so all the bars will have the same color.
In the other hand if you need to keep the chart as you shown on the picture shared, is possible to change every bar at once but just using a VBA code.

How to plot a horizontal line in excel from a single value?

Is there a way to plot a single horizontal line in excel using the value from a single cell? So without having to create a column filled with the same value for every point?
Edit: I'm trying to add the horizontal line to an existing lineplot
You'll need to enter the value in the first and last row of data.
1) insert your chart
2) Right-click on it and choose "Select Data Source" from the drop-down menu
3) Select your series on the left hand side of the dialog box
4) Click on "Hidden and Empty Cells"
5) In the resulting dialog box, select "Connect data points with line
I created a new "Name" (Formulas/Name Manager) with the formula:
=SEQUENCE(1,[number of datapoints],[value that we want to plot],0)
Then we select the chart, go to Chart Design/Select Data, and Edit our Series. In Values, we need to add:
='[Sheet name]'![Name we gave to the "Name" we created]
This works for Charts of dynamic sizes, since we can use COUNT to know how many datapoints we have. It also updates when we change the value we want to plot.

Spin button for showing Month by Month on Chart Graph

So i have the template layout in the picture attached below. I would like to know how to link the Spin button to able to show month by month when i click on the spin button.
Here is the formula i have so far, everything working fine except for the chart doesn't connect to the spin.
E4 formula : ="Monthly "&E5&" - Audit Sheet Delivery"
data for eat month for LATE row:=IFERROR(VLOOKUP(G3,$A$4:$C$6000,2,FALSE)," ")
Same for On-Time:=IFERROR(VLOOKUP(G3,$A$4:$C$6000,3,FALSE)," ")
Spin button link to cell $E$5
I have created define name for each Month, Late and On-Time and linked it to the chart but it doesn't work.
Please point out what i have to do in this case. Also, please show the code on here due to i am new to this. Thanks
Thanks you all for your help. I did figure out one way to make it work for me. However, i will more than happy to learn new way or a better way to use spin button and scroll button to changing my chart.
Changes data layout table
Using index formula and vlookup (Cell F19, G19,H19) formula included in picture below)
Changes define name formula to pull data from Cell (Cell F19, G19,H19).
Now i can click on my spin button and the chart changing month by month for me.
It is working fine for me. But i love to learn more if anyone can show me a better way to do it. Please include pictures and formula in your answer. It will help me and other easy to follow it. Thanks
How to do anything anything Excel can do, but with VBA code:
Virtually anything you can do manually in Excel (ie, via the ribbons/toolbars) has an equivalent in VBA.
If you are unsure of which VBA method or property to use, you can turn on the macro recorder and manually perform the action. The macro recorder translates your actions into Visual Basic code. After you record your actions, you can modify the code to do exactly what you want.
There are some limitations to recording macros, so if needed, certain actions have to be added after recording, such as conditional branches (eg., IF statements), variables usage loops, error handling, and text selections made with the mouse (however keyboard combinations do record).
Record an action:
For example, if you want to automate the process of saving the file with a new name, but you don't know which property or method to use, you could do this:
On the Developer ribbon, click
Change the default macro name to a name of your choice and click OK to start the recorder.
Hit F12 to open the Save As... dialog and save the file with a new name.
On the Developer ribbon, click
On the Developer ribbon, click Macros.
Select the macro name that you assigned (in Step 2) and click to view the VBA code within.
See the tips & resources at the links below to help get you started with automatizing Excel (and other Office applications) using VBA code.
More information:
Office.com : Assign a macro to a Form or a Control button
MSDN : Getting Started with VBA in Office
MSDN : Recording a Macro to Generate VBA Code)
MSDN : Revising Recorded VBA Macros
homeandlearn.org : Excel VBA For Complete Beginners
Stack Overflow : Overview of Form Controls and ActiveX Controls
Original Post:
How to filter a chart
The ability to filter a chart by month is built-in to Excel. After you create a chart, you can change the data series in two ways:
Use chart filters to show or hide data in your chart, or,
Use the Select Data Source dialog box to edit the data in your series or rearrange them on your chart.
Filter data in your chart
Click anywhere in your chart.
Click the Chart Filters button next to the chart.
On the Values tab, check or uncheck the series or categories you want to show or hide.
Click Apply.
If you want to edit or rearrange the data in your series, click Select Data, and then follow steps 2-4 in the next section.
Once you know how to use the filters, you can record a macro while filtering as required, an use the code for buttons or other controls.
More Information:
Office.com : Change the data series in a chart
MSDN : Recording a Macro to Generate Code
MSDN : Revising Recorded Visual Basic Macros
Steps
This is broadly similar to yours. Below is just meant to show you how to use dynamic named ranges as chart series sources. If you later decide to specify start and end ranges of months, you could use this same model and have the start and end indexes generate the height argument for Offset thus being able to plot ranges (though they would be aggregate).
Using the same data layout as in your answer.
① Add a forms control spin button, assign its linked cell as K3, then put the font to white so it is not visible. Its values run from 1-12 with increment 1.
② I then create two dynamic ranges:
LATE with formula =OFFSET(Sheet1!$G$4,Sheet1!$K$3-1,0,1,1)
OnTime with formula =OFFSET(Sheet1!$H$4,Sheet1!$K$3-1,0,1,1)
You can add these via name manager (Alt+F3)
Name manager:
③ I then insert a bar chart and add two series which use these dynamic named ranges as their source:
The above is for Late and this is repeated for OnTime. Note that the workbook name goes before the reference to the dynamic range.
④ In J2 I enter the chart title text "Monthly - 5 KPI Delivery" and point the chart title at this with = J2 in formula bar whilst chart title is selected on the chart.
⑤ K2 has the formula =INDEX(F4:F15,K3) and is used to retrieve the Month name from the list of months via Index with row argument the linked cell value from the spin button.
I then edit the chart X axis source with formula =Sheet1!$K$2 so the month name appears on the bottom of the chart.
⑥ Finally, any other chart sprucing you like. I chose to group and lock the chart and spin button together so they will move as a unit and to ensure data point values where shown.
Final result:
In action:

Excel text data import Step 3 select columns via keyboard on Mac

I am experiencing the following issue in Microsoft Excel for Mac 2016. When using the From Text data import function and clicking through the first two steps (selecting "Delimited" and defining delimiter), Step 3 allows for changing the column data format. By default, column 1 is selected and I can click to select any other column that fits into the window, as shown in the screenshot below. However, it seems that it is not possible to select columns that are to the right of those visible in the window. In my example below, there are about four more columns to the right. Scrolling and arrow-keys seem to not work in the Mac version.
Is there a keyboard shortcut, or some other workaround, that I am missing?
Perform a two-finger touch (not a complete tap), more like a contact. A slider bar will appear at the bottom of the columns. Now is your chance to grab it with one-finger click. If you begin with the pointer in the bottom part of the columns, it is much easier to grab the slider as it should be under the pointer. This probably works on other such windows.

How to extract each color bar and copy them in a table?

I made a diagram to show unique columns with several colors in each, as shown in the picture.
I have hundreds of that to make and I have no idea about how to do that.
I would like to know if it's possible to extract each color bar separately and copy them under "Icons". I am not sure if the word "extract" is the correct term, but I would like to display a raw-image of that color bar.
Maybe a formula?
I am able to use Office Excel and Libreoffice Calc.
Thank you so much.
These are instructions to do this manually, but this would be an ideal project to apply VBA and automate these tasks.
The idea is to create each category of stacked bar as its own individual chart, which can then be exported or copied to an image file.
This is based on the "spark lines" concept, which is small, eye-catching graphics embedded within the text of a document, as opposed to large graphics. MS added some sparklines functionality in recent versions of Office apps, and although MS "spark lines" doesn't support stacked bar chart type, the same thing can still be accomplished with a little work.
Step 1: Select one row of the data and do Insert Chart, stacked bar.
Step 2: Select data and Switch Rows & Columns.
Step 3: Delete the gridlines, axes, chart border, etc., .
Step 4: Expand the Plot Area so that it covers the entire Chart Area, and format the data series to 0% gap width.
Step 5: Apply your colors to each point in the series.
Step 6: Resize the chart to fit on a cell.
Finally now that you have created some ChartObjects you can manipulate them. ChartObjects can be Exported as image files, or copy/paste-special as images, bmp, or enhanced metafiles, etc.

Resources