Advanced Excel Chart Techniques
Table of Contents
1. How to graph a Normal Distribution
The chart above is built using the NORM.DIST function and is called Normal Distribution or Bell Curve chart.
This curve is often used in probability theory and mathematical statistics.
Instructions
First I'll show you how to construct the data needed, then insert a chart. Lastly, customize the chart to make it look better.
Normal distribution data
The chart requires two sets of data, x and y. Enter values from -4, -3.5, -3 ... to 4, they will be x-axis values shown in column B in the picture below.
The NORM.DIST function allows you to calculate the normal distribution for each x value.
Formula in cell C21:
Copy and paste this formula to cells below, as far as needed.
Insert a chart
Select the cell range, in my example B21:C37.
Go to tab "Insert" on the ribbon then press with left mouse button on the scatter chart button.
Press with mouse on "Scatter with smooth lines" button.
The chart shows up, clearly, we have to do a few changes to this chart.
Customize chart
The y-axis values are in the middle of the graph if you want to move it to the left or right follow these steps.
- Press with right mouse button on on x-axis values. (Yes, x-axis.)
- Press with mouse on "Format Axis..."
- Find "Vertical axis crosses" setting.
- Select Axis value and type a value. In my example, -6.
Press with mouse on major gridlines and press delete button to delete them, if you prefer.
Change the chart title.
Get Excel *.xlsx file
How to graph a normal distribution.xlsx
2. How to build an arrow chart
This chart is an arrow chart that has horizontal and vertical lines, positive arrows are green and negative arrows are red.
How to build an arrow chart
I am going to use a scatter chart to plot these lines, I will have two different series, one for the green arrows and one chart series for the red arrows.
The following data set shows how I arranged values in order to get an ending arrow for each group of chart values.
Select the first series (green arrows).
Go to tab "Insert" on the ribbon.
Press with left mouse button on the "Insert Scatter (X,Y) or Bubble chart" button.
Press with left mouse button on the "Scatter with Straight Lines and Markers" button.
Press with right mouse button on on chart and then press with left mouse button on "Select Data...".
Press with mouse on the "Add" button.
Select the x and y values.
Press with left mouse button on the "OK" buttons.
Doublepress with left mouse button one of the series to open the task pane.
Go to tab "Fill & Line", press with left mouse button on the "Marker" button and then press with left mouse button on radio button "None" to remove markers. Select the other chart series and repeat the steps once again to remove the markers for the second chart series.
Now go to "Line" and change the color for both chart series. If the smoothed line check box is checked then deselect that one as well.
Change the "End Arrow type" and the End Arrow size" to display arrows for each line.
3. How to graph an equation
Why graph an equation?
Graphs make it easier to analyze features of the equation like intercepts, increasing/decreasing, maxima/minima, concavity, etc. Examining a graph can reveal insights.
What are intercepts?
Intercepts refer to the points where a function or curve intersects the x-axis and y-axis. There are two main types of intercepts: x-intercepts and y-intercepts. Identifying these intercepts provides insight into the function and can help derive key characteristics.
What is an increasing/decreasing equation?
- Increasing - The graph is rising as it moves left to right. The y-values increase as x increases.
- Decreasing - The graph is falling as it moves left to right. The y-values decrease as x increases.
Identifying increasing/decreasing intervals helps understand the function's behavior.
What are maxima/minima?
Maxima and minima refer to the points where a function reaches its highest or lowest value.
- Local maxima is the highest value in a region and global maxima when absolute highest over all x values.
- Local minima is the lowest value in a region and global minima when absolute lowest over all x values.
What is concavity?
Concavity refers to the shape of the curve and whether it curves up or down.
The two types of concavity are:
- Concave up - The curve resembles a cup or smile shape opening upwards. Indicates the rate of change is increasing.
- Concave down - The curve resembles a frown shape curving downwards. Indicates the rate of change is decreasing.
What are inflection points?
An inflection point is a point on the curve where the concavity changes from concave up to concave down or vice versa.
3.1 Chart an equation
The picture above shows the following equation
plotted on an x y scatter chart.
3.2 Calculate values
Here are the instructions on how I built this chart:
- Type -10 and -9 in cell A2:A3
- Select cell A2:A3Â and press and hold on the black dot.
- Drag down until you see the number 10.
- Release the mouse button
- Select cell B2 and type:Â =A2^3+3*A2^2-3
- Press Enter
- Double press with left mouse button on dot in the lower right corner. This copies the formula to cells below as far as there are cells containing values in column A.
3.3 Insert x y scatter chart
- Go to tab "Insert" on the ribbon
- Press with mouse on scatter chart icon
- Press with mouse on the scatter chart you prefer, I chose Scatter with straight lines.
3.4 Change the x and y axis minimum and maximum value
- Press with right mouse button on on x axis
- Press with mouse on "Format axis..."
- Change minimum and maximum value
- Change major units
Repeat with y axis.
3.5 Format x and y axis
- Select x axis again
- Press with mouse on Fill and Line icon
- Select "Solid Line" and pick a color.
- Repeat with y axis
Useful resources
How to Plot an Equation in Excel
4. Build a comparison table/chart
I found a chart that I wanted to show you how to build. It contains values both horizontally and vertically, the intersecting cells are colored based on conditions.
The printable planting guide is found here. This is what the color means:
Light green : Plants grow well together.
Red : Don't plant together.
Dark green : The combination helps bug control.
Yellow : Carrots will have good flavor but stunted roots.
Grey : Beneficial to the garden in general.
Start typing the plant names in cell A2 and continue with cells below.
4.1 How to transpose values vertically to horizontally?
The animated image above shows a smaller set of values being transposed.
- Select cells in cell range A2:A31.
- Copy cells.
- Select the destination cell.
- Press with left mouse button on the "Paste" button. A pop-up menu appears.
- Press with left mouse button on the "Transpose" button.
4.2 How to orient cell values vertically?
The image above shows cell values in B1:D1 aligned vertically.
- Select cell range B1:AE1.
- Press with right mouse button on on cell range B1:AE1. A pop-up menu appears.
- Press with left mouse button on "Format Cells..." on the pop-up menu. A dialog box shows up, see image below.
- Go to tab "Alignment".
- Change "Orientation" to 90 degrees, see image above.
- Press with left mouse button on OK button to apply settings..
4.3 How to change column width for multiple columns simultaneously?
The animated image above shows how to change column width by dragging the column border with the mouse.
- Select columns B:AE.
- Press and hold with left mouse button on any column border.
- Drag with mouse until column width is around 20 pixels,
- Release the left mouse button.
Tip!
- Select columns B:AE.
- Doublepress with left mouse button on with left mouse button on any column border in B:AE.
This adjusts the column width to the text.
4.4 How to apply cell background color using conditional formatting?
The image above shows the cell grid populated with numbers, we are going to color the cell background using Conditional Formatting based on these numbers.
- Type 1 for green, 2 for red, 3 for grey, 4 for dark green and 5 for yellow in cell range B2:AE31.
- Select cell range B2:AE31 and go to tab "Home" on the ribbon.
- Press with left mouse button on "Conditional formatting" button.
- Press with left mouse button on "New Rule..".
- Select "Use a formula to determine which cells to format", see image below.
- Type =B2=1
- Press with left mouse button on "Format..." button.
- Go to tab "Fill".
- Pick a color.
- Press with left mouse button on OK button twice.
Repeat above steps for cell values 2, 3, 4, and 5 but the formulas become =B2=2, =B2=3 , B2=4 and B2=5 and pick different fill colors.
4.4.1 Explaining conditional formatting formula
Conditional formatting formula:
Step 1 - Relative cell reference
B2 is a relative cell reference, it changes when the CF formula moves to the next cell. For example, the CF formula moves to cell B3 and the relative cell reference then changes to B3.
This evaluates the contents of each cell and colors the corresponding cell background based on the its cell value.
Step 2 - Cell value is equal to 1
The equal sign compares the contents of cell B2 to 1.
B2=1
becomes
""=1
and returns FALSE.
Step 3 - Evaluate TRUE and FALSE
If the logical expression returns TRUE the cell background changes to green. If FALSE then nothing happens.
4.5 How to hide cell values using cell formatting?
The image above shows the cell grid without the numbers only cell background colors. The numbers are still there, however, you can't see them. Select a cell and the number shows up in the Formula bar.
Here is how to hide the numbers in cell range B2:AE31.
- Select B2:AE31.
- Press CTRL + 1. A dialog box appears.
- Press with left mouse button on "Custom" category, see image below.
- Type ;;;
- Press with left mouse button on OK button to dismiss the dialog box and apply settings..
4.6 How to create cell borders?
The image above shows cell range A1:AE31 selected. Here is how to insert borders to cell range A1:AE31:
- Select A1:AE31.
- Go to the "Home" tab on the ribbon.
- Press with left mouse button on "Borders". A pop-up menu shows up.
- Select "All Borders".
You could color each cell manually, but in my opinion, building this chart is a lot easier using cell numbers.
5. Heat map yearly calendar
The calendar shown in the image above highlights events based on frequency. It is made only with a few conditional formatting formulas and an Excel defined table that allows you to add new events or edit/delete old ones.
5.1 Conditional formatting formulas
What you perhaps want to customize is how events are highlighted. The following table shows how conditional formatting is used.
Event frequency | CF formula |
1 | =SUMPRODUCT((INT(INDIRECT("Table1[Start]"))<=B6)* (INT(INDIRECT("Table1[End]"))>=B6))=1 |
2 | =SUMPRODUCT((INT(INDIRECT("Table1[Start]"))<=B6)* (INT(INDIRECT("Table1[End]"))>=B6))=2 |
3 | =SUMPRODUCT((INT(INDIRECT("Table1[Start]"))<=B6)* (INT(INDIRECT("Table1[End]"))>=B6))=3 |
4 | =SUMPRODUCT((INT(INDIRECT("Table1[Start]"))<=B6)* (INT(INDIRECT("Table1[End]"))>=B6))=4 |
This image shows the rules manager for conditional formatting formulas, it shows you the fill color I used and the calendar cell range it is applied to.
5.2 Explaining CF formula
The following CF formula is the one that identifies dates that have only one event scheduled.
Step 1 - Check date in calendar with start column in Excel table
The INDIRECT function returns the cell reference based on a text string and shows the content of that cell reference.
Function syntax: INDIRECT(ref_text, [a1])
Check if date in cell B6 is larger than or equal to start dates. The INDIRECT function is needed to be able to use an Excel table name in a Conditional Formatting formula.
The INT function removes the decimal part from positive numbers and returns the whole number (integer) except negative values are rounded down to the nearest integer.
Function syntax: INT(number)
INT(INDIRECT("Table1[Start]"))<=B6
becomes
INT({41282.375; 41330.3333333333; 41312.3333333333; 41351.4166666667; 41365.5; 41421.75; 41438.3333333333; 41448.625; 41283.3333333333; 41283.3333333333; 41312.3333333333; 41313.3333333333; 41314.3333333333; 41357.4166666667; 41366.5; 41408.75; 41408.75; 41449.75; 41462.75; 41472.75; 41613; 41477; 41478; 41479})<=B6
becomes
{41282; 41330; 41312; 41351; 41365; 41421; 41438; 41448; 41283; 41283; 41312; 41313; 41314; 41357; 41366; 41408; 41408; 41449; 41462; 41472; 41613; 41477; 41478; 41479}<=41273
and returns
{FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE}
Step 2 - Check date in calendar with end column in Excel table
INT(INDIRECT("Table1[End]"))>=B6))
returns
{TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE}
Step 3 - Multiply conditions (AND logic)
In order to identify a date inside an event range both conditions must be met.
(INT(INDIRECT("Table1[Start]"))<=B6)* (INT(INDIRECT("Table1[End]"))>=B6)
becomes
{FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; FALSE} *Â {TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE; TRUE}
and returns
{0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0}.
Step 4 - Sum events
Function syntax:
SUMPRODUCT((INT(INDIRECT("Table1[Start]"))<=B6)* (INT(INDIRECT("Table1[End]"))>=B6))
becomes
SUMPRODUCT({0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0})
and returns 0 (zero).
Step 5 - Check if the number of events equal 1
If the sum is equal to 1 then the Conditional formatting formula returns TRUE and the cell is highlighted, if not then the formula returns FALSEÂ and the cell is not highlighted.
SUMPRODUCT((INT(INDIRECT("Table1[Start]"))<=B6)* (INT(INDIRECT("Table1[End]"))>=B6))=1
becomes
0=1
and returns FALSE. Cell B6 is not highlighted.
5.3 Populating the Excel table
The following picture shows the Excel defined table containing the data about each event, the event name, when it starts and when it ends.
5.4 CF formula examples
If you want to highlight cells that have less then 5 events scheduled with a given color then use this CF formula:
If you want to highlight cells that have greater then 5 events and less than 10 events scheduled with a given color then use this CF formula:
There are also CF formulas that hide dates and formatting on each month because some cells show the previous or the next months dates. The calendar looks cleaner without them.
5.5 Get Excel *.xlsx
Note that no VBA is used in this workbook, however, there is a VBA solution demonstrated below if you prefer that.
5.6 Heat map - VBA Solution
Hi, I would like to use this example with my dataset, however, I'd like to visually show the number of events per date to understand when are we the busiest, slowest, etc. and be able to forecast using this data.
Ideally, I would like some sort of data bar or color change indicating the level for each date (Jan 1 has 10 items while Jan 2 has 3 and I can visually see that in each cell instead of seeing numbers or a solid color for each cell (here yellow and blue).
Answer:
This article demonstrates how to highlight events on a yearly calendar based on frequency per day. You will find a link to this workbook at the end of this article.
The color on the calendar gives a rough estimate on the number of events per date.
- No color no events.
- Light color one or a few events.
- Darker color means many events.
You add, edit or delete events to worksheet "Table" and every time you go back to worksheet "Calendar" the colors are refreshed by the macro below.
There is a specific cell next to the calendar that allows you to change the highlight color if you prefer. Press with mouse on that cell and change the cell color to a color you want.
5.6.1 VBA code
- Press with right mouse button on on sheet Calendar
- Press with left mouse button on "View Code"
- Copy vba code below
- Paste code to sheet module
- Exit VB Editor
Private Sub Worksheet_Activate() Dim CRng As Variant Dim Dt As Variant Dim CDt As Variant Dim Cnt As Integer Dim r As Long Dim c As Long Dim St As Integer Application.ScreenUpdating = False CRng = Worksheets("Calendar").Range("B6:X38").Value With Worksheets("Table") For r = 1 To UBound(CRng, 1) For c = 1 To UBound(CRng, 2) If CRng(r, c) <> "" Then For CDt = 1 To .Range("Table1[Start]").Cells.Count If CRng(r, c) >= Int(.Range("Table1[Start]").Cells(CDt).Value) And CRng(r, c) <= Int(.Range("Table1[End]").Cells(CDt).Value) Then Cnt = Cnt + 1 End If Next CDt End If If Cnt > St Then St = Cnt Cnt = 0 Next c Next r End With Set Rng = Worksheets("Calendar").Range("B6:X38") 'Remove previous formatting With Rng.Interior .Pattern = xlNone .TintAndShade = 0 .PatternTintAndShade = 0 End With With Worksheets("Table") For Each Dt In Worksheets("Calendar").Range("B6:X38") For CDt = 1 To .Range("Table1[Start]").Cells.Count If Dt >= Int(.Range("Table1[Start]").Cells(CDt).Value) And Dt <= Int(.Range("Table1[End]").Cells(CDt).Value) Then Cnt = Cnt + 1 End If Next CDt If Cnt > 0 Then With Dt.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .Color = Worksheets("Calendar").Range("AB5").Interior.Color ' xlThemeColorAccent4 ' .TintAndShade = 1 - (Cnt / St) .PatternTintAndShade = 0 End With 'Reset counter a Cnt = 0 End If Next Dt End With Application.ScreenUpdating = True End Sub
5.6.2 WorkSheet "Table"
The picture below shows the events in an Excel defined table named [Table1].
You don't need to adjust cell references or formulas everything is automatic, Excel defined Tables are great in that aspect.
You can find a heat map monthly calendar here.
5.6.3 Get excel *.xlsm file
6. Advanced Gantt Chart Template
This Gantt chart uses a stacked bar chart to display the tasks and their corresponding date ranges. Completed days are green and remaining days are red, see image above.
The chart utilizes an Excel defined Table in a very efficient way, you don't need to adjust chart data source ranges when you add or delete records. The Excel defined Table takes care of that for you.
6.1 How to build worksheet
First you need to convert your data into an Excel defined Table.
6.1.1 Excel defined Table
- Select a cell in your data set.
- Press CTRL + T.
- Enable the checkbox if the data set contains column headers.
- Press with left mouse button on OK.
Now you need to create a stacked bar chart.
6.1.2 Insert a stacked bar chart
- Select one of the cells in the Excel defined Table.
- Go to tab "Insert" on the ribbon.
- Press with mouse on "Insert Column or Bar Chart" button.
- Press with mouse on "Stacked Bar chart" button.
- A chart appears, however, we need to customize it quite a lot before we can use it.
6.2 Customize stacked bar chart
The data source ranges are not what we want but we can easily change those.
- Press with right mouse button on on chart
- Select "Data source..."
- Change the first Legend entry "Days" so i points to column "Start Date" in the Excel defined Table".
- Press with left mouse button on "Edit" button (Horizontal (Category) Axis Labels and change the cell reference so it points to the "Activity" column on the Excel defined Table.
- Press with left mouse button on OK button.
The chart now looks like this:
We are now going to remove the blue bar.
- Double-press with left mouse button on one of the blue bars to open the format pane.
- Press with mouse on the Fill & Line button.
- Select "No fill".
If you want the tasks to be arranged in reverse order then follow these steps.
- Double press with left mouse button on the y-axis categories to open the Format Pane, see image above.
- Press with mouse on "Axis Options" button.
- Press with left mouse button on the checkbox "Categories in reverse order.
The image now looks like this, the dates are however in a mess.
- Double-press with left mouse button on x-axis values to open the Format Pane.
- Press with mouse on "Axis Options" button.
- The "minimum" value is the number equivalent to an Excel date, in this case, 10/24/2011. The first date range starts at 20/11/2011 which is number 40868. I will use 40867.
- Feel free to change the maximum value as well.
I recommend that you apply minor gridline to make the chart easier to read.
- Press with right mouse button on on x-axis values.
- Press with left mouse button on "Add minor gridlines".
- Change the "Minor" value to 1 in the Format Pane.
- Select and delete the major gridlines.
Repeat above steps but this time with y-axis values.
If you prefer the x-axis values below the chart then double-press with left mouse button on the y-axis values to open the Format Pane.
Press with left mouse button on "Horizontal axis crosses" At maximum category.
Recommended blog posts
Gantt Chart with Repeated Tasks via Excel XY Chart | Peltier Tech BlogÂ
7. Dynamic Gantt chart
This section demonstrates how to create a dynamic Gantt chart. A Gantt chart helps you plan and track various elements of a project. A dynamic chart automatically adds new values to the chart. Let's start!
Create a table
- Select cell range (A1:D7)
- Press with left mouse button on "Insert" tab on the ribbon
- Press with left mouse button on "table" button
- Press with left mouse button on ok!
Create a stacked chart
- Select table
- Go to "Insert" tab
- Press with left mouse button on "Bar chart" button and then press with left mouse button on "Stacked bar" button.
Setting up the stacked chart
- Press with right mouse button on a blue bar
- Press with left mouse button on "Format Data Series..."
- Press with left mouse button on "Fill"
- Press with left mouse button on "No Fill"
- Press with left mouse button on OK!
- Press with right mouse button on on chart
- Press with left mouse button on "Select Data"
- Select "Finish Date"
- Press with left mouse button on "Remove" button
- Press with left mouse button on OK!
Format x-axis
- Press with right mouse button on on x axis dates
- Press with left mouse button on "Format axis.."
- Change "Minimum:" and "Major unit:" to fixed
- Change "Minimum" value to 40547.
- Change "Major unit:" value to 7.
- Press with left mouse button on "Alignment"
- Change "Text direction:" to Rotate all text 270
- Press with left mouse button on Close
Setting up the legend
- Press with left mouse button on text "Start date" in legend
- Delete
- Press with right mouse button on on chart
- Press with left mouse button on "Select Data"
- Press with left mouse button on "Duration"
- Press with left mouse button on Edit
- Change "Series name:" to Sheet4!$A$1 (Activity)
- Press with left mouse button on OK!
8. How to replace columns with pictures in a column chart
I found an interesting chart on CNN's website: Rise of the supersize rugby player It shows the average height of athletes for the past 40 years. Check it out.
It made me think how can I do this in Excel? First I drew this nice man, see the image below. I am going to use this picture in my chart. It is not as nice as the other chart but it will do for this demonstration.
8.1. Create a column chart
- Select the data, see image above.
- Go to tab "Insert" on the ribbon.
- Select a new clustered column chart.
8.2. Delete the chart legend
- Press with left mouse button on the chart legend to select it.
- Press Delete on your keyboard to remove it from the chart.
8.3. Change chart gap width
- Press with right mouse button on on the data series.
- Press with left mouse button on "Format Data Series...". You will now see a dialog box or a settings pane depending on what Excel version you are using.
- Press with left mouse button on Series Options.
- Change gap width to 20%.
- Close the dialog box.
8.4. Insert a picture to chart column
- Press with left mouse button on "Fill and Line"
- Press with left mouse button on "Picture or texture fill".
- Press with left mouse button on the "Insert.." button.
- A dialog box appears. Select a picture file you want to use.
- Press with left mouse button on Insert.
8.5. Change min y-axis value
- Press with right mouse button on on chart y-axis, see image above. A popup menu shows up.
- Press with left mouse button on "Format axis..."
- Press with left mouse button on "Axis Options".
- Change the minimum value to 0 (zero).
- Press with left mouse button on OK.
9. Schedule project dates based on a finish date
I have a schedule that I am working with and based on one date (ie. 6/4/) different processes take different times to complete (ie. one step could only take a week, another could take up to 4 weeks).
Is there a formula I can use to calculate each step in the process based off of the date range of completion for the first step in the process?
So for example, if you look at the BBD date at the bottom, all of the steps above it take a certain amount of time to complete and have to be finished on time in order for the project to be complete by 1/4/.
Instead of typing in manually the date ranges I am trying to write a formula that will allow me to input the project date (ie 1/4/) and have all of the other steps populate themselves based on how long they take to complete (ie. the manuscript to CE step could take 2 weeks, the manuscript from CE could take 1 week and so on). I hope that makes sense??
ie. ONE ROUND From: To:
Manuscript turnover 6/25/ 7/30/
Manuscript to CE 8/6/
Manuscript from CE 8/20/
Manuscript to author 8/27/
Manuscript from author 9/10/
Ms to comp 9/3/2012 9/17/
Pages from comp 10/8/
Pages from author 10/22/
Pages to proofreader 10/29/
Pages from proofreader 11/12/
Pages to comp 11/19/
Confirming proofs 11/26/
Ship to printer 12/3/
BBD 1/4/
Answer:
I calculated the duration for each step (column E) and the days between each step (column F). I then used the calculations in column E and F to calculate new dates in cell range E15:D23 based on a new finish date in cell D24.
The following formula calculates the number of days between From: and To: dates.
Formula in cell E3:
The IF function checks if cell C3 is blank and then returns 0 (zero) if TRUE and D3-C3 if FALSE. Copy cell E3 and paste to cell range E4:E11.
The formula below calculates the number of days between tasks.
Formula in cell F3:
Copy cell F3 and paste to cell range F4:F11.
9.1 Calculate new dates based on finish date
The following formula in cell C15 checks if C3 is blank and returns a blank if TRUE or returns D15-E3 if FALSE. D15-E3 calculates the From: date by subtracting the duration from the To: date.
Formula in cell C15:
Copy cell C15 and paste to cell range C16:C23.
The formula below calculates the To: date by subtracting the number of days between the tasks from the To: date of the next task.
Formula in cell D15:
Copy cell D15 and paste to cell range D16:D23.
The formulas above make it possible to change the date in cell D24 and the other project dates will follow based on the calculations made in the first table.
This Gantt chart shows the processes and the days between, green days are the task duration and red days are the number of days between the current task and the next task.
Read more about Gantt charts here: Dynamic Gantt charts
Built-in Charts
Combo Charts
Combined stacked area and a clustered column chartCombined chart – Column and Line on secondary axis
Combined Column and Line chart
Chart elements
Chart basics
How to create a dynamic chartRearrange data source in order to create a dynamic chart
Use slicers to quickly filter chart data
Four ways to resize a chart
How to align chart with cell grid
Group chart categories
Excel charts tips and tricks
Custom charts
How to build an arrow chartAdvanced Excel Chart Techniques
How to graph an equation
Build a comparison table/chart
Heat map yearly calendar
Advanced Gantt Chart Template
Sparklines
Win/Loss Column LineHighlight chart elements
Highlight a column in a stacked column chart no vbaHighlight a group of chart bars
Highlight a data series in a line chart
Highlight a data series in a chart
Highlight a bar in a chart
Interactive charts
How to filter chart dataHover with mouse cursor to change stock in a candlestick chart
How to build an interactive map in Excel
Highlight group of values in an x y scatter chart programmatically
Use drop down lists and named ranges to filter chart values
How to use mouse hover on a worksheet [VBA]
How to create an interactive Excel chart [VBA]
Change chart series by clicking on data [VBA]
Change chart data range using a Drop Down List [VBA]
How to create a dynamic chart
Animate
Line chart Excel Bar Chart Excel chartAdvanced charts
Custom data labels in a chartHow to improve your Excel Chart
Label line chart series
How to position month and year between chart tick marks
How to add horizontal line to chart
Add pictures to a chart axis
How to color chart bars based on their values
Excel chart problem: Hard to read series values
Build a stock chart with two series
Change chart axis range programmatically
Change column/bar color in charts
Hide specific columns programmatically
Dynamic stock chart
How to replace columns with pictures in a column chart
Color chart columns based on cell color
Heat map using pictures
Dynamic Gantt charts
Stock charts
Build a stock chart with two seriesDynamic stock chart
Change chart axis range programmatically
How to create a stock chart
Excel categories
26 Responses to “Advanced Excel Chart Techniques”
Leave a Reply
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form
Oscar,
This is brilliant!!! I love how this is set up because if the duration of one step changes I can update it and then my schedule will automatically change too! Thanks for your help! I'll def remember you in the future if I need help!
Danielle
Danielle,
you are most welcome! Thanks for commenting!
Ola boa noite
preciso de sua ajuda no seguinte
tenho na celula A1 a data de 23/01/2009
tenho na celula A2 a data de 28/06/2011
preciso de uma formula que me de como resultado os dias meses e anos que separam as duas datas ou seja como resultado quero 5/05/02
è que se fizer A2-A1 da-me como resultado mais um mes 5/06/02
Martins,
Hello good evening
I need your help in the following
I am in cell A1 to date 23/01/2009
I'm in cell A2 of the date 28/06/2011
I need a formula I as a result of the days, months and years between two dates or as a result I 05.05.02
è is made A1-A2 of me as a result over one month 06/05/02
I think this webpage answers your question:
https://www.cpearson.com/excel/datedif.aspx
Read: Calculating age
Hi Oscar,
I love this calendar, but I have a couple of questions about it,
1) Is there any way of having the Table appearing alongside the calendar so you don't have to flick between the two sheets each time you want to add something.
2) Say I selected cell Calendar! N7 (07/02/13), is there any way of highlighting events 3 and 11 on the table which affect this date.
Thanks,
Chris
Chris G,
Great comment!
Press with left mouse button on image to view larger version.
Get the Excel *.xlsm file
Heat-map-calendar-v2.xlsm
Hi Oscar,
I've opened the attached file for the second version, the table itself is visible, along with the refresh calendar option and it's working great, however it isn't highlighting the table like it does in the screenshot. How do I get it to highlight the related events for the date?
Thanks,
Chris
Chris G,
That is weird. I opened the file and it is working here.
The workbook contains some code in the sheet module:
Press with right mouse button on sheet name and press with left mouse button on "View Code". The code should be there?
The sheet also has a conditional formatting formula applied to the table:
=(INT(INDIRECT("Table1[@Start]"))<=$AD$4) *(INT(INDIRECT("Table1[@End]"))>=$AD$4)
How about a Sparkline (single barchart) that fills the cell/background up to xx%.
//Ola
Ola,
I don´t think that is possible. Conditional format | Data bars uses the cell value and you can´t enter your own conditional formatting formula.
Hi Oscar ,
I am using Excel 2007 , and I had the same problem as Chris ; the CF coloring of the events table was not working.
I changed the CF formula to :
=(INT($AB7)=$AD$4)
after selecting the entire events table AA7:AC27.
Everything works correctly now.
Hi ,
The formula in my earlier post has been changed by the website software ! What I had copied was :
=(INT($AB7)<=$AD$4)*(INT($AB7)>=$AD$4)
is equal to (INT($AB7) is less than or equal to $AD$4) multiplied by (INT($AC7) is greater than or equal to $AD$4).
K. Narayan,
Thanks for sharing a solution! I changed your last comment.
I am not sure why wordpress removes greater than or less than signs.
Oscar - hey i really like how this is formatted -
however, would it be possible to change the calendar so instead of looking at how many events are on a certain day - it looked at a number associated with a day (1-100) and days with a high number are color coded red and days with a low number are color coded blue?
thanks!
Paul
Hi Oscar,
This is very useful but as i add more events i now get a Run-time error '5': Invalid procedure call or argument at the tint and shade line.
"with Dt.Interior
.TintandShade = 1 -(Cnt / St)
"
i think it has to do with the value being greater than 1.
Is there an alternate to the calculate i could use.
Thanks in advance and thankyou for your articles as i have learnt alot from them.
Regards Tammy
Tammyw,
can you upload an example file?
Hi Oscar,
Sorry for delay but having great trouble with your website access.
This is the code i'm using to stop the error.
[If (Cnt / St) > 1 Then
.TintAndShade = 1 - (Cnt / St) / 10
Else
.TintAndShade = 1 - (Cnt / St)
End If]
i have 52 rows of 'Deliverables' and 12 columns of dates (Periods 1 to 12), therefore a large count number of dates.
This solution works well for me at the moment.
Thanks again for your interesting posts,i have learnt a great deal from them.
Tammyw,
Sorry for delay but having great trouble with your website access.
Yes, I have had some trouble with the server database.
This is the code i'm using to stop the error.
i have 52 rows of 'Deliverables' and 12 columns of dates (Periods 1 to 12), therefore a large count number of dates.
This solution works well for me at the moment.
Thanks for posting!
Thanks again for your interesting posts,i have learnt a great deal from them.
Thank you!
Hi Oscar,
I need to chart task planned v's actuals and i'm stuck. i've tried gantt & x/y but can't get it to work for multiple calendar periods.
Example data
Deliverables Period11 Actuals11 Period 12 Actuals 12
Task 1 17/11/2014 12/11/2014 15/12/2014 17/12/2014
Task 2 19/11/2014 20/11/2014 17/12/2014
Task 3 20/11/2014 20/11/2014 18/12/2014
Task 4 20/11/2014 24/11/2014 18/12/2014
Any help appreciated.
Tammyw,
What are the calendar periods?
Task 1 17/11/2014 - 12/11/2014 and 15/12/2014 - 17/12/2014?
How would I go about creating a code to filter according to certain events? Fore example if I wanted to filter in order to just show Holidays.
Hello Oscar! This is a really good file, thanks a lot for sharing. I have no idea about how VBA works but i want to make a calendar like this to see a heat map of revenue received throughout the year.
In my "Table" i only need 2 columns:
1. Date from Jan 1 to Dec 31
2. Revenue on each day
How do i get this to reflect on the calendar?
Since it's unlike an event with a start and end date, i'm not sure how i can amend this. Thank you so much for your time.
You're help a lot, thanks so much.
Ferreira,
thank you!
Hi Oscar,
Thank you for sharing these very useful projects openly, I really appreciate that.
I am trying to lay down course schedules on a weekly calendar of all the first year courses, which could have shades of colors showing range of capacities for each schedule type (lectures, tutorials and labs). But there will be overlapping events. Every term, I am trying to find the void spots in student schedules to fit in my workshops to the gaps. This is how my data looks like:
Course Name Course Code Schedule Type Capacity Time Day
Chemistry II CHEM 1020U Lec 69 9:40 am - 12:30 pm M
Chemistry II CHEM 1020U Lec 69 9:40 am - 12:30 pm W
Chemistry II CHEM 1020U Lab 23 1:10 pm - 4:00 pm R
Chemistry II CHEM 1020U Lab 23 9:10 am - 12:00 pm F
Chemistry II CHEM 1020U Lab 23 1:10 pm - 4:00 pm F
Introduction to Programming ENGR 1200U Lec 75 1:10 pm - 4:00 pm T
Introduction to Programming ENGR 1200U Lec 75 1:10 pm - 4:00 pm R
Introduction to Programming ENGR 1200U Tut 75 5:40 pm - 7:30 pm M
Introduction to Programming ENGR 1200U Tut 75 5:40 pm - 7:30 pm W
Calculus II MATH 1020U Lec 234 9:10 am - 12:00 pm T
Calculus II MATH 1020U Lec 234 9:10 am - 12:00 pm R
Calculus II MATH 1020U Tut 36 4:10 pm - 7:00 pm T
Calculus II MATH 1020U Tut 36 4:10 pm - 7:00 pm R
Calculus II MATH 1020U Tut 36 12:10 pm - 3:00 pm F
Calculus II MATH 1020U Tut 36 9:10 am - 12:00 pm F
Calculus II MATH 1020U Tut 36 4:10 pm - 7:00 pm T
Calculus II MATH 1020U Tut 36 12:10 pm - 3:00 pm F
Calculus II MATH 1020U Tut 18 9:10 am - 12:00 pm F
Linear Algebra for Engineers MATH 1850U Lec 144 4:10 pm - 7:00 pm T
Linear Algebra for Engineers MATH 1850U Lec 144 4:10 pm - 7:00 pm R
Linear Algebra for Engineers MATH 1850U Tut 38 9:10 am - 12:00 pm F
Linear Algebra for Engineers MATH 1850U Tut 38 12:10 pm - 3:00 pm F
Linear Algebra for Engineers MATH 1850U Tut 38 9:10 am - 12:00 pm F
Linear Algebra for Engineers MATH 1850U Tut 38 12:10 pm - 3:00 pm F
Thanks in advance,
Eda
Eda Aydin,
Perhaps this weekly calendar will work for you?
https://www.get-digital-help.com/2010/02/26/calendar-with-scheduling-in-excel-2007-vba/