Showing posts with label Excel Charts. Show all posts
Showing posts with label Excel Charts. Show all posts

Saturday, August 10, 2013

Creating Advanced Waterfall graph - Values moving from Positive to negative and vice-versa

Waterfall graph is a floating bar graph used to pictorially depict movement of any parameter or how various parts contribute to a whole parameter. For e.g. how the Headcount or profit has moved over last week, last month etc. OR various components of Net profit and so on. Given below is the example of a sample waterfall graph.

Please note that in the above graph values moves from Positive to negative and vice-versa, which makes process of making this graph little complicated. If your data is not going to cross 0 axis (i.e. not going to move from positive to negative) then please click HERE
 to see steps of making simple waterfall graph.

Steps to make waterfall graph

Step 1: Make the data table.
  1. Create the data table for base values and movements in the below mentioned format.











  2. Since the values moves from positive to negative and negative to positive, we will have to create another table linked to the above table

    • In the table above, I have used two dummy columns (cells with gray background) which are not used in graph, but are used for calculating other values 
    • Before – Running total before the current row value
      • Formula – =SUM($B$2:C2)
    • After – Running total after the current row value
      • Formula – =SUM($B$2:C3)
    • Axis Label – Self explanatory
    •  Base Value – For Start and end points
      • Formula – =IF(B2<>0,B2,0)
    • Blank – For a hidden series for adjustment
      • Formula – =IF(J2*K2>0,IF(J2*C2>0,J2,K2),0)
    •  Positive Bars – Used for depicting bars above 0 (Horizontal axis)
      • Formula – =IF(J2>0,IF(K2>J2,C2,IF(K2<0,J2,ABS(C2))),IF(K2>0,K2,0))
    • Negative Bars – Used for depicting bars below 0 (Horizontal axis)
      • Formula – =IF(J2<0,IF(K2<0,-ABS(C2),J2),IF(K2<0,K2,0))
Step 2: Make the graph
  1. Select the second data table (Only upto Negative Bar column) and Click Insert --> Column Chart --> Stacked column (this will insert stack bar graph as shown in the screenshot below)

  2. Select the legend and press delete to remove legend
  3. Select adjustment series and hide it by selecting No shape fill and no shape outline from format menu.

  4. Apply same Shape colour to Positive and Negative Bars. So that it appears as a single bar while crossing the Horizontal axis.

  5. Change the Axis label setting to Move the axis label below the negative values. Right click on Axis --> Format Axis --> Change Axis Label property to “Low”

  6. Make other formatting changes like Border, background colour, font, Gridlines etc.
Finally it should look similar to the screenshot below.




You can download the Excel file for above example from HERE.

Sunday, May 12, 2013

Creating Trend Graph / bar graph with scroll bar in Excel - (Adding Scroll bar in Excel Graph)

Purpose:
To add scroll bar in the graph to scroll through the available values. If you fit too many data points in any trend or bar graph then it looks very cluttered and shabby. Look at the sales trend graph below...



In the above charts, it's very difficult to make out anything as it contains lot of information with too many data points and hence they are overlapping and very difficult understand.


Question is then what should we do to represent such large data in limited available space?

How about adding scroll bar for to the graph and display only few number of data points so that the chart is understandable and more readable? One can scroll through to see more data points. See the example below...





How to insert scroll bar in the graph:

  1. Make your data ready for all the values of the X axis. For our example, we need to make data for all the days starting from 1-Jan to 31-Mar.
  2. Copy few data points to a new location from the base data and make the chart only with few data points.(click here to see steps for making graph)


  3. Insert scroll bar object from developer ribbon. (if developer ribbon is not available refer enable developer ribbon in excel 2010 or enable developer ribbon in excel 2007)


  4. Set the below properties of the scroll bar (enable Designed Mode to select the Scroll bar)
    • LinkedCell: The cell in which Excel stores the value of the scroll bar. In our example we will give M1 for this property.
    • Min - This the value of the scroll bar when it's at lowest point i.e. at the left most point. For our example we will give this value as 0.
    • Max - This is the value of the scroll bar when it's at highest point. i.e. at the right most point. In our example we will give this value as 77. (the difference between the highest and lowest point of X axis of the all data minus number of values visible on the graph i.e. difference between 31-Mar and 1-Jan minus 12)
    • Large Change & Small change: It is the increment value for every point change in the scroll bar. In our example, we will increment value by one since on each left or right arrow click of scroll bar, we want the period of the graph to be shifted by one day.


  5. Based on the scroll bar value, insert formula to get X axis values of the graph. In the given example I have entered the starting date in one cell and added the scroll bar value to that to get the starting point of the X axis. Remaining values of the X axis are derived by adding 1 to the previous value.


  6. Use lookup formula to get the data for selected period from the entire data. Exit the Design Mode and try changing scroll bar.
Download Sample file

Further enhancing dynamic chart:
I have explained simple method of preparing dynamic chart using scroll bar in this article. In addition, you can further enhance and add more functionality like providing drop down list also. Refer to how to create dynamic chart for adding this feature.
Note: for providing scroll bar as well as drop down list in the same graph, you will have to modify your base data and the lookup formula to derive value for the graph.