This is a guest post by Vijay, our in-house VBA Expert.
Hello Everyone,
This post shows how to make project risk maps using VBA. If you have modern versions of Excel (365, 2019 or 2016 with TEXTJOIN() function), see the Excel Risk Map Template page.
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 – Data for Project Risk Maps
First of all we will understand what we are trying to create here by looking at the image below.

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.

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.

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.Type this in a blank cell and then copy “=tblProject[Project]”.
- 2.Bring up the Name Manager by pressing CTRL + F3, or by going to the Formula’s Tab and clicking on Name Manager.
- 3.Click on New
- 4.Type the name lstProject in the Name box
- 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.

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
- inputRange – this is the SearchString columns data
- SearchString – this is a manual enrty such as “x257”
- dataRange – this is the Display Name column from where we will pick the name of the project to display
- 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.
Click here for Risk Map Template for new versions of Excel.
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.

















30 Responses to “Great News: Chandoo becomes MVP”
Congratulations! It's well deserved. 🙂
This is amazing. Hearty congratulations and a rocking new year ahead!!!
Congrats! I have learnt alot from your site... and the most important is learning how to achieve the most with the simplest concepts.
Thanks for the excel calendar. Is it possible to get a simple big fonted calendar printable on an A4 size paper without any distracive notes or visuals? BTW, I have already signed up for your newsletter. With warm regards and
Gratefully yours
50+ year old CHarish.
Hey Chandoo,
Great to hear that. Congratulations! The best new year gift, I would say. Keep it up, u've been doing extraordinary work for the excel users community.
Regards,
Pankaj Verma
Congrats dude... fantastic news!
congratulations! your site is great, this is well deserved
Rich
I recently found your site, I visit many. The tips that you provide are in the top 1% of all the sites I visit. Keep on Excelling.
Arnold
South Africa
Congratulations, Chandoo! That's a great way to start the year and make the PHD even better.
Congratulations, Chandoo.
Your site is one of most useful on the net. Happy new year and lot of ideas you will present for us.
Congrats.
Just read your name in an email from Abhishek. Well deserved.
Congratulations, and Happy New Year.
Greetings from Rio de Janeiro my friend! You trully deserve it!
Nive way to start 2009! Keep up the good work!
FC
That was quite forseeable , so you have now really got your PhD in excel.
Anyways Chandoo you have made excel a real Fun doo
I will like you to write some more on INDEX and MATCH function in near future.
@Hey Chandoo ! Congrates....
Ab to treat mangta hai !
Well deserved Chandoo!!
Congrat's!! Very well deserved 🙂
i always browsed mr.excel and used to see MVP writtne below names of people who used to solve queries in excel forum there......i just used to admire as to what they have special in them that they are MVP......
but now i got my answer...............u deserve it man..........
@All: thanks everyone 🙂
Congratulations Chandoo, nice job!
Chandoo,
A well deserved recognition and a good start to the New Year. Continue your good work.
Subbu
Many Congratulations.
You deserve a Ph.D. 🙂
congrats.....
Congrats dude. Rock on!
[...] charting community in 2007 and has been growing strongly ever since. In year 2009, I have received the MVP award from Microsoft. Just few days back I have become a dad [...]
Respected sir,
I am impressed!.... Good job done.. Keep it up...
Sir, How to be a MVP certified person. What level of knowledge is required for it? send me links if possible.
Please reply...
Regards,
Dipak Khalasi.
Dipak -
The first thing you need to cultivate is the ability to search the web effectively. You could start by Googling "Microsoft MVP".
[...] boy and girl which has been made hectic and incredibly fun ever since to their life.He has been awarded MVP status in 2009 by Microsoft(and renewed in 2010,2011 & 2012).His MVP profile is here.If you want to contact him direct then [...]
Congrats Chandoo!!
[…] Chandoo becomes MVP […]