We all know that area charts are great for understanding how a list of values have changed over time. Today, let’s learn how to create an area chart that shows different colors for upward & downward movements.
The inspiration for this came from a recent chart published in Wall Street Journal about Chinese stock markets (shown below).

We will try to create a similar chart using Excel.
This is what we are going to come up with.

Looks interesting? Read on…
Creating an area chart with different colors for up & down slopes
Step 1. Gather the data
For our example, let’s use Indian stock market data for last 10 years. Specifically, BSE Sensex weekly closing prices between 1-July-2005 and 27-July-2015.

There are 3 columns in this data – Date, Closing price & Volume, as shown below. Let’s say all of this data is in a tabled named data that starts at cell B6.
Step 2. Find out when to switch colors
The next step is to find out when to switch colors.
We can add 3 additional columns to our data to spot the switches, and split data to Advances & Declines accordingly.
Here is what we get.

Detecting when a switch occurs:
When looking at closing price for a day, we need to know if the line direction has changed or not. To detect this, we can use a formula like this:
Assuming the closing price we are looking at is in cell C7,
=C7<>MEDIAN(C6:C8) will tell us if the value in C7 is switching the trend or not.
Why does this formula work? Think again. For more on this technique, refer to BETWEEN Formula in Excel.
Step 3. Expanding the data so that we can create an area chart
If we create an area chart with just the data from above step (only advances & declines columns), we end up with a chart that looks like this.

As you can see, the green & red areas (advancing & declining data) have tiny white space between them.
This is because, when we switch from green to red, the green series goes from peak to 0 and simultaneously, red series goes from 0 to peak, creating an effect like below (chart made from sub-set of data)

To create correct shading effect, we need to expand the data so that on dates when switching happens, there is a duplicate row.
See below illustration to understand what we need.

Writing formulas to expand data
We can use simple arithmetic along with healthy dose of INDEX formulas to create expanded data set. Can you figure out the formulas yourself as homework?
Please examine the downloadable workbook to understand these formulas more.
After expanding the data, the same area chart looks like this:

Step 4. Create area chart from expanded dataset
Select the expanded advances & declines columns and create an area chart from them. Make sure horizontal axis labels are pointing to the expanded date column we constructed in step 3.
Your chart is ready now.
We can add few more bells and whistles to it and come up with below output.

- The volume chart at the bottom is a sparkline
- We can find longest bull & bear rallies using longest winning streak formula
Download Area Chart with different colors for up & down slopes workbook
Please click here to download area chart with different colors workbook. Play with the chart & formulas to learn more.
How do you like area chart with different shades?
I think this is a powerful technique to quickly eye-ball data and see where directional changes are occurring, what patterns (if any) are they following etc.
If you observe carefully, our Excel version and WSJ’s charts differ in one key aspect. In WSJ chart, they are shading bull & bear markets where overall trend is upwards or downwards with minor changes during the market period. What formula / approach changes do you think are necessary to make exact replica of WSJ chart in Excel?
Also, do share your feedback about this chart and how you are planning to reuse the concepts at your work.
Addendum – Moving average based smoothing of trends
We can use simple moving averages to smooth the trends so that we can spot upward / downward movements better.
Here is an example chart.

You may download this workbook to examine the formulas & chart.
Charts to show change over time
Understanding change is a key component of any analysis. Check out below charting techniques & tutorials to learn few more valuable skills.
- Narrating the story of change – Case study on how fast America changes its mind
- Advances vs. Declines chart
- How tax burden has changed over years – interactive Excel chart
- Use indexed charts when analyzing change over time
- Never show simple numbers in your dashboards
- Comparing with benchmarks – shading under / over achievement














22 Responses to “Master Excel 2007 Ribbon with this Free Learning Guide”
Thank you, kind sir. Well done with the baby making.
I cannot get signed up for your newsletter. I tied both this email address and churchill2001@hotmail.com. never a response.
I cannot get signed up for your newsletter. I tied both this email address and churchill2001_at_hotmail_dot_com. never a response for either attempt.
@Doug, it shows that your email address is pending verification. Can you check your inbox (and may be spam folder too) for an email from me? The subject will be "Activate Subscription to Get your Free Excel Tips E-book"
[...] PPS: If you are struggling with ribbon, you should check out ribbon learning guide. [...]
Very Useful Info..Keep it up..
@Ajay.. you are welcome 🙂
how do u download microsoft excel for free?
http://www.microsoft.com/en-us/default.aspx
Select Office
Free Trial
[...] Excel 2010 UI looks considerably better and less stressful than 2007. The colors are dull and subtle. The icons don’t call for attention unless you want to do something. The menus / ribbons feel smoother and slicker. [Learn to use Excel Ribbon with this Free e-Book] [...]
I can't open this pdf. I get the error message:
You do not have the required license to open this file.
Please request a license from the creator of the file, and add it using the license manager and they try opening it again.
What gives??
I downloaded the file again and it worked this time. Strange. (First file was 116 KB, second was 1644 KB... ???)
[...] More ribbon goodness | Free e-book to learn Excel Ribbon [...]
Hi Chandoo,
thanks for sharing your Excel 2007 learning experience with us; unfortunately the link to the pdf of the free Excel 2007 learning guide seems broken: my Acrobate Readers flags: "Unkown file type or corrupte data".
Have a nice day
Michael
well done this is great
Can somebody just provide a link the classic TAB exportedUI files for MS Office 2003 for us to use in office 2007/2010?. searching online, everybody just wnats to make a buck online with silly Classic Tab installers which do nothing more than inport exportedUI files for you.
Don't give me a ribbon how to guide, just give me free exportedUI files. I should not have to pay anyone for this, it is free XML, MS should have included this to begin with.
thanks
Dear.
There are a set of debit values and a set ot credit values in a column. I want a vba code by whcich the debit value plus a single / multiple credit value is zero that needs to be marked .
finally i will come to know out of the avaibale debits which cannot be used the with avilable credits either single or multiple values.
If multiple matching sets are available let it take the 1st or the 2nd one its not an issue.
Column A Ref
-1000 A
-5000 B
-8000 C
800 A
100 A
100 A
2000 B
3000 B
13000
15000
hi...
how to make this add-ins and display in ribbon... check this sample : http://www.cprsoft.com/GCDemo01.htm
thank you sir...
Please tell me format painter short cut key In excel ?
Thanks In Advance
thankfully.likeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
I am very much happy for such a great opportunity given to excel learners to advance their skills for the betterment of the future. I am a great user of this site and feel proud to have come across this web site.
I appreciate this, because I didn't do much works in my project management studies using gantt chart. As of now are have now learned some advancement.