Ads 468x60px

Wednesday, May 29, 2013

Excel Risk Map

Excel Risk Map:
This is a guest post by Vijay, our in-house VBA Expert.
Hello Everyone,
We all have some projects to manage every now and then and there are needs of various trackers that help us in gauging the progress of the same. One of the most important things are heat maps that quickly help us in visually displaying the names of the projects that need special attention and resolve issues that are impacting them.
So go ahead and grab a cup of coffee and read this article that would help you in creating a Risk Heat Map in excel (will use some double shot espresso in the form of VBA code) to help us to the target.

Before we begin

First of all we will understand what we are trying to create here by looking at the image below.
risk-map-project-risks-in-excel
You would have seen a picture like this while managing project risks.
So today we will be learn how to create this in Excel to become more awesome in managing projects.
What is important here is how your data for the projects/entities being tracked laid out. We will use the Excel data tables [structured references] to help us here.

risk_map_data_table
There is a Setup sheet in the excel file where we can add the names of the projects that we will use on the data table, as well as the Probability and Impact have been defined as data tables. This helps us in using their contents as drop down options in the data table.
risk_map_setup_sheet

Adding Named Ranges

We need to use the Name Manager to create named ranges to be able to use the data table columns as drop down items, this is show below.
  1. 1.Type this in a blank cell and then copy “=tblProject[Project]”.
  2. 2.Bring up the Name Manager by pressing CTRL + F3, or by going to the Formula’s Tab and clicking on Name Manager.
  3. 3.Click on New
  4. 4.Type the name lstProject in the Name box
  5. 5.Paste “=tblProject[Project]” in the Refers To box and the click on OK.
Repeat this process for “=tblProbability[Probability]” and “tblImpact[Impact]”
Now you can go the actual risk data table and select the Project columns first blank cell and put in Data Validation List here, choose List and put the Source as lstProject. Repeat this for Probability and Impact cells. You will only need to this one time for the first row, new rows when added to the table will automatically contain these settings.
After we have created the above data table, we need to add 3 columns to the right side where we will setup the calculation that will be used to update the risk map.
a) First Column is named as “ProbabilityScore” Since probability has been marked as “A, B, C or D”, we would need to convert this into a number. This is done by using the below formula.

=IFERROR(CHOOSE(MATCH([@Probability],lstProbability,0),4,3,2,1),”")
b) Second Column is named as “SearchString”

=IF([@Status]=”Open”,CONCATENATE(“x”,[@ProbabilityScore]^4+[@Impact]),”")
c) Third column is named as “DisplayName”

=CONCATENATE([@ID],” “,LEFT([@Project],20),IF(LEN([@Project])>20,”…”,”"))

Understanding the SearchString Table

When creating the SearchString we are raising the probability score to the power of 4, this is what I have chosen you may select any number that you need. Below is the resulting matrix of numbers that we obtain by doing this.
risk_map_score_table
The last columns in only used for trimming the name of the project to 20 characters of there is a big name, else the actual name of the project is used to display in the Risk Map.

Understanding the Code

So now we are ready to look into the VBA code that helps us in creating the Risk Map.


Public Function showRiskMap(inputRange As Range, searchString As String, dataRange As Range, separator As String)

Dim cntr As Long

Dim tempArray() As Variant

Dim tempDataArray() As Variant

Dim tempString As String

tempArray = inputRange.Value

tempDataArray = dataRange.Value
For cntr = LBound(tempArray) To UBound(tempArray)

If tempArray(cntr, 1) = searchString Then

tempString = tempString & tempDataArray(cntr, 1) & separator

End If

Next

showRiskMap = tempString

End Function


We are sending 4 parameters to this function which are
  1. inputRange – this is the SearchString columns data
  2. SearchString – this is a manual enrty such as “x257”
  3. dataRange – this is the Display Name column from where we will pick the name of the project to display
  4. separator – this is CHAR(10) which is a line break in case we have multiple projects falling in the same category
We are making use of Array’s here to pass the data from the Table column into the array and then a simple For loop to parse them and show us the results.
I hope you will enjoy this article and this assist in managing your projects in a much efficient way.

Download Excel Risk Map File

Click here to download the file & use it to understand this technique.

Do you use Excel for creating Risk Maps?

Do you also user Excel for creating Risk Maps? If yes please put in the comment below how do you use the same and what has been your experience. Leave a comment.

More on VBA & Macros

If you are new to VBA, Excel macros, go thru these links to learn more.

Join our VBA Classes

If you want to learn how to develop applications like these and more, please consider joining our VBA Classes. It is a step-by-step program designed to teach you all concepts of VBA so that you can automate & simplify your work.
Click here to learn more about VBA Classes & join us.

About Vijay

Vijay (many of you know him from VBA Classes), joined chandoo.org full-time this February. He will be writing more often on using VBA, data analysis on our blog. Also, Vijay will be helping us with consulting & training programs. You can email Vijay at sharma.vijay1 @ gmail.com. If you like this post, say thanks to Vijay.

Saturday, May 18, 2013

How to find sum of top 3 values based on filtered criteria [video]

How to find sum of top 3 values based on filtered criteria [video]:
Sum of top 3 values meeting filtered criteria - how to calculate using Excel formulas?Today, lets tackle an interesting problem.
Lets say you are looking at some data as shown aside and wondering what is the sum of budgets for top 3 projects in East region with Low priority. How would you do that with formulas?
This article is inspired from a question asked by acpt22 in our forums.


Sum of top 3 values based on filtered criteria [video]

Watch below video to understand how to find sum of top 3 values using formulas & pivot tables.
Watch this video on our YouTube channel.

Download Example Workbook

Click here to download example file and play with it. Examine the formulas & pivot table settings to learn this technique better.

Do you calculate sum of top ‘n’ values often?

Often, I have to calculate sum of top ‘n’ values and I use SUMPRODUCT + LARGE combination. SUMPRODUCT (or simply SUM) is such a versatile formula that you could almost use it when your car breaks down on a free way.
What about you? Do you calculate sum of top ‘n’ values? Which techniques do you use? Please share using comments.

Learn more

If you sum & count for your living, then you are going to love below tips.

Tuesday, May 14, 2013

How to transpose a values in a row to column using formulas… [Quick tip]



This is interesting, I am in Columbus to meet one of my college friends. I remember him as a very meticulous person from college days. So it is no surprise when he showed me his massively impressive finance tracker last night. He has been tracking expenses, income, credit card payments and gas (petrol) consumption since 2008. Very impressive indeed.
Then out of blue he said, he has a problem with his spreadsheet. In this own words,
When entering data for credit cards, I use one column per card. But in my report view, I want to show credit card details in rows. How do I do this?
Something like this:
How to transpose a values in a row to column using formulas...

Transposing values in a row to column using formulas

If it is a one time process, my friend can use Paste Special > Transpose feature and be done. But this is no one time business. So lets understand which formula helps us do this.
  1. Lets assume original data is in $F$4:$J$5. Row 4 has card names & Row 5 has amounts.
  2. Wherever you want the out put, just list running numbers (1,2,3….) in a column. Lets say these are in cells D10:D14.
  3. To get the first card name, you can use the formula =INDEX($F$4:$J$4, $D10)
  4. To get the first amount due, use the formula =INDEX($F$5:$J$5, $D10)
  5. Now drag both these formulas down and you are done!
This is good, but I don’t like the extra column…
If that is the case, you can use the ROWS() formula to generate these running numbers for you on the fly. For example,
=INDEX($F$4:$J$4, ROWS($A$1:A1)) would work perfectly.
Learn more about: using ROWS / COLUMNS formula to generate running numbers.

Play with this formula

See the embedded Excel workbook below. Play with the formula.
(alternatives: "http://img.chandoo.org/q/transpose-formula.xlsx" target="_blank">download the example file orview it online)

How do you transpose values?

I love using INDEX formula. I use it for transposing values, tables, getting a cell value (or reference) from a large table, use it along with MATCH etc. It is a very versatile formula and I keep learning new uses for it.
What about you? Do you transpose values often? What formulas do you use? Please share using comments.

More on transposing your data:

If you like to transpose, wrestle or arm twist your data often, then you are at right place. Chandoo.org has tons of tutorials, material and tricks on this. Start with these:
Also, check out more quick tips.

Thursday, May 9, 2013

I am meeting Mr. Excel aka Bill Jelen tomorrow. What do you want to ask him? (book giveaway too)

I am meeting Mr. Excel aka Bill Jelen tomorrow. What do you want to ask him? (book giveaway too):
Bill Jelen a.k.a. Mr. Excel - I am meeting him for first time tomorrow (10May2013). Post your questions to him and you could win a book.One of the beautiful things about working on internet is you know so much about people even before you meet them first time. I think I first heard about Mr. Excel in 2006, when I started my career as business analyst. I landed on mrexcel.com while searching for something related to doing cluster analysis using Excel. In a way, mrexcel.com inspired me to share my thoughts and techniques on Chandoo.org.
So it wont be an understatement when I say, I feel like a kid in candy store knowing that Bill Jelen aka Mr. Excel is just a few miles away from where I live. Since Rob Collie and Bill are good friends, I asked Rob if we 3 can meet for dinner. And Bill said yes. 
I am meeting Bill for dinner on Friday and Rob, Bill & I will be discussing spreadsheets, technology, share our experiences and bump ideas off each other.

So what is in it for you?



But I want you to be part of this too. So go ahead and  post your questions to Bill in comments. I am going to ask him all these and feature in an interview style post (with a photo Bill and me of course) next week. You can ask anything related to Excel, Bill’s life, mrexcel.com or general stuff. Hilarious, whacky, outright fun questions are welcome.

Bonus: Signed copy of Bill’s book

I will pick one random commenter (on this post) and send her / him a signed copy of one of Bill’s books. I am trying to get Excel 2013 in-depth, but the title may change if we cant get hold of a copy in time.
The book will be autographed by Bill Jelen, Rob Collie and yours truly.
I am sure as a Chandoo.org visitor, you know the value of this. Just in case you don’t, here we go: You might be able to sell it for millions if the world becomes spreadsheet oriented as we approach singularity :P

Go ahead and ask your questions

Go ahead and ask your questions thru comments. (Click here to comment)

Excel Links – from USA edition

Excel Links – from USA edition:
Hello there,
My travel to US was fantastic and fun. Many thanks to Jocelyn & Rob Collie, who found a nice apartment for us and made sure we are settled down in almost no time. Weather has been excellent so far too with lots of sunshine and blue skies. We went to a nearby park the other day and kids really loved walking on trials and exploring.

Gentle reminder

Today is last day to sign-up for my USA Masterclass


Today is last day to join my USA Advanced Excel & Dashboards masterclass with early bird discount. If you live near Chicago, Washington DC or Columbus and love Chandoo.org style of teaching, then you will benefit alot from my masterclass. We have very few spots left in Chicago & Columbus. So go ahead and book yours today and save $200.
Click here to know more and join us.

Excel links – after a long time

After a long time, I have a few more Excel links to share. Check out these for useful Excel tips, information & ideas.
Neat compilation of Excel keyboard shortcuts

Dave & Lisa (his wife) created this beautiful, searchable, PC & Mac compatible list of Excel keyboard shortcuts. Check it out to learn something useful. [More keyboard shortcuts]
Create small multiples (panel charts) automatically [Excel workbook]

James sent me this beautiful Excel VBA file using which you can generate small multiples chart from a large, cluttered chart. You just enter all the data, create one big chart, tell how you want your small multiples and press a button – bingo, your small multiples are ready.
Making pretty annual report in Excel

Joey at Darkhorse analytics discusses how we can create a beautiful annual report using Excel alone and why it is important to make your work look pretty as well. Check out the downloadable file and see it yourself. PS: You need install a font if you want to see it perfectly.
Building waffle charts in Excel

Mike shows us how to create waffle charts, which are nothing but square pie charts. Very interesting technique. (You can create waffles with conditional formatting too.).
Summing data across multiple sheets with multiple criteria

Liam shows us how to calculate sum of all values across multiple sheets that meet a given criteria using INDIRECT formulas, tables and Excel trickery.
PS: here is a pic of Chandoo family in Chagrin falls park in Cleveland :)

PPS: If you live in Cleveland or near by shout out in comments. We can catch up for some coffee next week.




Monday, May 6, 2013

How to create a column chart with background image in Excel ?

How to create a column chart with background image in Excel ?:
Tony sends this chart and asks if it can be done in Excel.
It sounded like a good challenge for a lazy Sunday morning. So here we go. (Posting it on Monday).
How to create a column chart with background image in Excel ?
Now I could not get an oil rig photo or that data. So I made up few numbers and used a photo of Flinders street station I took when I was in Melbourne last year.

Step 1: Arrange the data.

Arrange the data like this.
Arrange data like this - column chart with background image in Excel
Step 2: Create a column chart
Select the data, insert a stacked column chart (why not a regular column chart?, you will understand in a minute).
You will get this.
Create a simple column chart -  - column chart with background image in Excel

Step 3: Set up image as background for chart’s plot area

Select chart’s plot area. Press CTRL+1.
Choose picture or texture fill and select the file with image you want.
Fill chart's plot area with an image -  - column chart with background image in Excel

Step 4: Add dummy max-series

In your data, add a column which gives the difference between column values & axis maximum. For our test data, I choose 1,400 as axis maximum, so the dummy series values are,
Dummy data series -  - column chart with background image in Excel
Now add this series to chart.

Step 5: Format the chart

Now, we are almost done. Our chart looks like below. We just need to format it.
Final chart before formatting -  - column chart with background image in Excel
  1. Select the columns (any series) and press 1
  2. Adjust gap width to 0%
  3. Fill the dummy series with a chosen background color.
  4. Make the data series transparent (fill color = no color)
  5. Add borders to data series. Border color should be same as background color.
  6. Adjust the border thickness to 3pts.
  7. Adjust axis maximum to 1,400 (or any value you have selected in Step 4).
  8. Remove grid lines, legend and any un-necessary chart fluff.
Your column chart with background image is ready!
Finalized column chart with background image made using Excel

Note of caution: Go easy with images

The main purpose of a chart is to convey information. By adding a background images, sometimes your chart will be difficult to read. So I suggest you to go easy with background images.

Download Excel workbook with this chart

Click here to download Excel file with this chart and play with it. Examine the chart formatting settings to understand this technique better.

Do you use background images in your charts?

I confess. I rarely use this technique, because finding good background image that can reveal data is very tricky. The oil rig image is an excellent choice. Also, certain things like drop-shadow for data series are not possible with our technique (as gap width = 0%). But I enjoyed figuring out this puzzle.
What about you? Do you use such charts? Please share your tips and techniques using comments.