Excel Shortout key to format axis bound? - excel

I’m required to adjust chart axis to show 97 to 100 range as shown in image using send hotkey.
I’ve done(from chart) ctrl 1, ctrl up x3, ctrl 5 to get this far. I need the shortcut key to get to min/max.
(Do refer to screenshot)
enter image description here
Any help is appreciated!

#Yuca is right - there is no built-in hotkey. Instead, you will want to record a macro using this link to get you started.
When you record a macro, it translates the clicks and actions you perform into VBA code. The biggest challenge you will have here is getting VBA code that will be general enough to apply to any chart, but specific enough to format it properly. It can be done, but you may need to record 2 or 3 versions of the macro to get it right.
Another option is to simply use your chart as a template. Read up here for how to save your chart as a template. After it has been saved, you'll be able to add all of your next data sets to a pre-formatted template!

Related

Add and save 'background' information or text in an Excel or Powerpoint file

I don't really know how to express what I'm looking for, so I'll give a bit of context:
I have and add-in for Excel and PowerPoint that allows the user to insert shapes into the worksheet/slide with specific sizes, colors and values to form a stylized chart. I don't use the integrated charts because my company needs some weird styles and parameters that I can only replicate using shapes.
The problem is that once the shapes are in the worksheet/slide the user cannot go back to the add-in and change the chart values or series. For example, a user can't redefine the values and instead of $50 put $90 and update automatically the chart (as with the Office charts that we all know and love).
So what I thought as a solution is to have a 'background text file' or something like that with a dictionary of the charts and the shapes that are part of it; also the values and other characteristics like the x and y axis values. This way, when the user goes back to the add-in, he/she can retreive all the info from the original chart and change values, parameters or whatever is neeeded -- using the shapes' dictionary.
In essence, I want to program something like Think-cell but in Visual Basic.
Any suggestion is very welcomed!

Replace value with the average of it's column - many columns

I have an excel sheet with over 1000 columns and 11000 rows - all with numeric data. Within the data, there are missing values represented with '*'.
I would like to replace all of the '*' values with the average of the column that it is in.
Doing this manually would take a long time, so is there a formula that would achieve this?
Thanks so much in advanced for any help.
I can give you a three sheet solution Sam?:
Sheet 2:
Cell A1=
=AVERAGE(Sheet1!A:A)
Paste that along the top row for each of 1000 columns in sheet 2.
Sheet 3:
Cell A1=
=IF(Sheet1!A1="*",Sheet2!A$1,Sheet1!A1)
Copy that and then paste it into the entire worksheet 3 (i.e., that top left corner symbol that allows you to do that). It's gonna take a while to update but will deliver what you want!
As you have mentioned machine learning I thought I would introduce you to how you could do this with Azure Machine Learning Studio (AML) using a free account.
By using AML you gain access to a number of methods for replacing missing values which are extremely quick. AML has a Clean Missing Data module which exposes methods of replacement such as Multivariate Imputation using Chained Equation, Mean, Median and several others. The great thing here is you can visualize the dataset columns by right clicking on the dataset and see which columns have skew. You can then select on a column by column basis which replacement method to use. If you have heavily skewed columns you might use median instead for instance. This also offers great opportunities for data normalization (scale and reduce). You also gain access to using Python and R with your dataset.
I don't know if there is a method for directly treating "*" as missing values, I am trying to find that out, but if you do a little processing in advance of load then all is fine. The step before loading requires:
Export the sheet as a CSV and save it.
Use Ctrl+ F to bring up the find and replace dialog and enter "~*" for Find and leave Replace blank
Then login into AML and click the + New at the bottom of the screen
Select New > DATASET > FROM LOCAL FILE and select your file
When selecting type ensure to select CSV with no header if you data has no header row or with header if it does:
Your dataset will start uploading as shown by progress bar at bottom of screen and then appear in the SAVED DATASETS collection.
Click the + New button again and select EXPERIMENT > BLANK EXPERIMENT
Drag and drop your saved dataset onto the canvas on the right:
In the Search experiment items box on the right, type: Clean Missing Data
then drag the module that appears onto the canvas
Join the 2 boxes by clicking the dot at the bottom of the top box and dragging to the other box
Select the bottom box and then input the following parameters on the right (here is where you can choose which method to apply for missing values e.g. replace missing with mean, or perhaps median if your column data is skewed.
Right click the bottom module and select Run selected
Right click again and select Cleaned dataset > Save as Dataset
The progress bar at the bottom will inform you when complete
Type in the Search experiment items box again: convert to csv and drag that onto the canvas and connect the left hand side bottom of the second module to the top of the newly added third:
Select the bottom module and right click > Run selected
Wait for the progress bar to complete.
Right-click the bottom module and hit Download. Done.

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:

Short-cut for selecting excel ready-made cell formatting. NOT formatting to table.

I have previously known an excel short-cut command that popped up an window where one could select a layout for a range of cells in the worksheet. There were many selections and several of them were quite beautiful. The layout would change the background color of the heading (first row selected), and format the first column and the cells in the body respectively.
I'm not talking about making tables or the table formatter, also it was only accessible through the shortcut command as far as I know (which I've now forgotten). Does anyone recall what I mean and could that person please share? I've been trying to remember it for some time now.
I believe what you first need to do is enable Excel to recognise your table. Take a look at my screenshot above!
By using Alt + O + A one will get up the AutoFormat window.

Excel: labels on a scatter chart, read from array

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

Resources