Last week we saw a number of Excel Tips, Tricks, Cheats & Hacks supplied by Microsoft Excel MVP’s.
This week I have invited the Chandoo.org, Excel ninjas to contribute their Excel Tips, Tricks, Cheats & Hacks.
Chandoo has Excel ninjas?
Absolutely!
Do they have swords?
No (sigh)
But you can read all about them here: Chandoo.org Excel ninjas
The Chandoo.org Excel ninjas have solved in excess of 63,000 Excel questions in the 7 years that Chandoo.org Forums have been active. Hence they are imminently qualified in all areas Excel and as such the tips and tricks they will share will be essential reading.
Lets go:
001. Find & Replace Hack No.1 – Shrivallabha
You can use CTRL+J to simulate the Enter character in “Find and Replace” or “Text to Columns” fields.
Example:
Download the sample file here: Download sample file
Cells B2:B4 contain text with multiple lines per cell
There is an invisible Enter Character in those cells that can be added via use of Ctrl+J or Alt+Enter as the data is entered
To seperate each line please follow these instructions
Select B2:B4
Goto the Data, Text to Columns tab
Select Delimited
Select Other and Type Ctrl+J in the adjacent box
Next
Change the Destination to D2
Enjoy
Contribution by: Shrivallabha
002. Find & Replace Hack No.2 – Shrivallabha
Using escape character ~(tilde) while replacing *(asterisk) from text in the Find and Replace box.
If someone does Find and Replace * directly then everything gets replaced as * acts as wildcard.
So you have to use ~* for replacing an asterisk * character in a string.
Contribution by: Shrivallabha
003. Select All – Shrivallabha
You can use the Select All Shortcut Ctrl + A to select all items listed below
- Items in a List
- Contiguous Cells in a Range
- All cells in a worksheet, press Ctrl + A twice
- All shapes, Select first shape, then press Ctrl + A
Contribution by: Shrivallabha
004. Apply a filter to the first row of a range – Shrivallabha
Apply a filter to the first row of a range
Select any cell in a range
ALT D + F + F (Applies filter to first row of the cells contiguous with the current cell)
Contribution by: Shrivallabha
005. Fill Blank cells with the value in the cell above – Asheesh
- Select the range that contains blank cells you need to fill.
- Click Home > Find & Select > Go To Special…, and a Go To Special dialog box will appear, then check Blanks option.
- Click OK, and all of the blank cells have been selected.
- Assume that the Top Left Blank cell is A3, then input the formula =A2 into active cell A3 without changing the selection.
- Press Ctrl + Enter, Excel will copy the respective formula to all blank cells.
- At this point, the filled contents are formulas, and we need to convert the formals to values.
- Select the whole range, copy it Ctrl + C, and then press Ctrl + Alt + V to active the Paste Special… dialog box. Then select Values option from Paste, and select None option from Operation.
Contribution by: Asheesh
006. Multiple Consolidation Ranges to Pivot table – Asheesh
You can use “Multiple Consolidation Ranges” of Pivot Table to generate a unique list from Multiple Sources.
Goto the worksheet where your data lists are
To achieve this you need to add the Pivot Chart Wizard to either the QAT or Tab Bar
Start the Pivot Table Wizard or use the Keyboard Shortcut ALT + D P
Select Multiple Consolidation Ranges then click Next
Select Create a single page field for me and Next
Select your data range, including a blank leading column and then click Add button.
Notice: As per the excel file A1:A7 is blank.The Data is in Columns B:D.
Had this not been the case then we needed to insert a new blank column at the left of the data and that is Column A in this example
Click on Finish button
You will have a table like the one in the below image in a new worksheet.
Now go the Pivot Table Field options and do the following
You should have a unique list of values
You can Right Click on the Grand Total and DeSelect Grand Total to remove the Grand Total if required
You can now use this list in a Named Formula, Data Validation, Chart or other use where the required Unique List is required.
Note: If the Source Data changes you will need to Right Click on the List and select Refresh Data
Refer to the attached file: Download Sample File
Hui, in his second post at Chandoo.org, actually wrote about this technique in Feb 2010 but using a Single List – Read it here
Contribution by: Asheesh
007. Hiding Rows that are blank – Faseeh
Hiding Rows that are blank.
I have a sheet on daily basis in which certain cells in a column are blank I want to hide the rows with those blank cells.
What I do is…
- Select the cell range (the column).
- Press F5, you will get the Go To Menu.
- Check the option Blank.
- Press Ctrl+9 to hide the selected range.
Contribution by: Faseeh
008. Hiding Rows that are blank – Faseeh
To use the subtotal function to get the serial number right is the one that my accounts department loves. They were tired of creating commercial invoices with serial number created by dragging manually.
Here is the procedure.
Serial Number list that do not change with Filter
Assume you want to enter serial in column A and your data is present in column B. The formula look like this: =SUBTOTAL(3,$B$4:B4)
Drag downward. (This is only one time drag). Now if you filter the list the serial number will be changed accordingly.
Contribution by: Faseeh
009. Slab Rate Formula – Faseeh
This is a formula for slab rate that gives total price for a quantity with given slab rate.
So we want the price for 2,000 items
The first 1,000 will cost 0.35, the second 1,000 will cost 0.33
The total cost is found by =SUMPRODUCT((E3>=A3:A5)*(E3-A3:A5)*(B3:B5-B2:B4))
Download a sample file here: Download Sample File
Contribution by: Faseeh
010. Navigation tricks to get around spreadsheet faster – Luke M
Use Ctrl+Arrow key to jump to end of range.
Use Ctrl+Shift+Arrow key to select all data to end of range
Contribution by: Luke M
If you’d like to hire Luke for an Excel project, contact him at:
LukeMoraga@gmail.com
011. Select Visible Cells in a Filtered range – Luke M
When dealing with filtered ranges:
Use Alt+; to select visible cells only
Contribution by: Luke M
If you’d like to hire Luke for an Excel project, contact him at:
LukeMoraga@gmail.com
012. QAT – The Quick Access Toolbar; Shortcuts – Luke M
I’ve seen many users who don’t know about, or use the the Quick Access Toolbar (QAT) very well.
Everyone has a list of things they use often. Put these on the QAT to improve your efficiency.
My favorite thing is that all items on the QAT get auto-assigned shortcuts of Alt+[1-9].
On my system, I have Paste Values and Paste Formulas in the 2nd and 3rd slots, so I can easily do those by hitting Alt+2 or Alt+3.
Press Alt +
1 2 3 4 5 6 7 8 9
Contribution by: Luke M
If you’d like to hire Luke for an Excel project, contact him at:
LukeMoraga@gmail.com
013. Keyboard Shortcuts – Marc L
Insert Current Date
Insert current date in a cell : Ctrl + ;
Insert Current Time
Insert current time in a cell : Ctrl + :
Bulk enter values or formula into several cells
To allocate same Value or Formula to several cells, Select the cells, enter the Value or Formula and
accept into all cells by Ctrl + Enter
Date Check also known as Toggle Values/Formula Mode
Ctrl + ~ (English keyboard) or Ctrl + “ (3 on a French keyboard)
Is a toggle between displaying formulas or values in cells.
But I use it as a trick to check if dates are real dates and not text :
When displaying formulas is active, real dates appear as number,
bad dates remain as text !
This is the reason why I won all by bets against guys who insisted
Contribution by: Marc L
014. Break Strings into Words – Hui
A regular requirement in VBA is to be able to extract say the Name and Surnames from a string
Eg: Retrieve “Ian” & “Huitson” from “Ian David Huitson”
But what if I want the Middle Name, or what if I have two middle names like my children do?
These functions quickly become very cumbersome
A technique I recently learned simplifies this, whilst extending it to other delimiters and any number of sub-strings
You can easily parse a delimited string into an array.
You simply use the Split function with the appropriate delimiter as parameter.
The following code shows an example of using the Split function.
The above code makes an array of values of size 3, Arr(0) to arr(2)
arr(0) will contain “Ian”
arr(1) will contain “David”
arr(2) will contain “Huitson”
If you are unsure of the number of array elements you should use the Ubound() function to determine the size
Ubound(arr,1) which will return the reference number of the last element = 2 in the example
in the example of my Name which has 3 elements
arr(2) = arr(Ubound(arr,1)) and each will contain the string “Huitson”
You can download both the above sample from this sample file
I picked this up a few months back from Excel Mastery, my new favorite Excel VBA site
Contribution by: Hui
015. Use the Camera Tool – BobHC
You can sue the Camera Tool to setup dashboards that quickly combine data from a number of worksheets into a common location
Read about its use: http://chandoo.org/wp/2008/12/02/excel-camera-tool-help/
And for fancy applications: http://www.addictivetips.com/microsoft-office/camera-tool-function-in-excel-2010/
Contribution by: BobHC
Closing
Many many thanks to the Chandoo.org ninjas who contributed above.
I hope you get to to revue all the tips and pass comments and appreciation back to the authors as appropriate.
Next week I have to do some real paid work and will travelling in Timor, Indonesia, but in two weeks time the Excel Tips, Tricks, Cheats & Hacks theme will continue with the Excel Tips, Tricks, Cheats & Hacks – Notable Excel Sites (non-MVP) Edition, so keep an eye out for that.
If you have any Excel Tips, Tricks, Cheats & Hacks that you would like to share with the community, please leave a tip in the comments below.
All the user contributions will be combined into one final post: Excel Tips, Tricks, Cheats & Hacks – Users Edition
15 Responses to “Highlight Employees by Performance Rating – Conditional Formatting Challenge”
While this might solve the question Shelly asked, there is another option that might be more useful - a pivot table could make a list of people who fall into the various categories, so, if you needed to simply see who got in the top bracket to give them a bonus, you would have that list
Simply sorting by the rankings would work too, but you would knock them out of alphabetical order.
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
The solution I chose makes use of the percentile formula.
The percentile formula returns the value representing the K-th percentile of a range of values. The range of values is the first criteria, and K is the second criteria in the formula.
I applied Conditional Formatting according to the formulas in the order below:
5% =$C6>=PERCENTILE($C$6:$C$33,0.95) Dark Blue
15% =$C6>=PERCENTILE($C$6:$C$33,0.85) Light Blue
65% =$C6>=PERCENTILE($C$6:$C$33,0.1) Green
10% =$C6>=PERCENTILE($C$6:$C$33,0.05) Light Red
5% =$C6<PERCENTILE($C$6:$C$33,0.05) Dark Red
The issue I noted with this approach is that Zambi was not highlighted in my solution as it is in the solution provided. Unless I am mistaken, and I very well may be, the 10th percentile for this data set is at 2.21, so Zambi would fall above the 10th percentile with a PR of 2.3.
The first step to this was figuring out the 'buckets'; what scores should fall into each range. In attempting to match the formatting of the spreadsheet, I determined the buckets below.
5% = 95% to 100%
10% = 90% up to but not including 95%
65% = 10% up to but not including 90%
10% = 5% up to but not including 10%
5% = under 5%
After that, it is a relatively simple matter to plug the necessary values into the conditional formatting formulas as shown above.
One final consideration is that while the buckets above match the color banding on the spreadsheet, I believe that the original request suggests a different color banding with 6 buckets shown below.
Top 5% = 95 to 100% Dark blue
Top 10% = 85 up to but not including 95% Light blue
Top 65% = 35 up to but not including 85% Green
Bottom 10% = 10% down to but not including 5% Light Red
Bottom 5% = 5% or under Dark Red
This leaves one final bucket of 10 to 35% (exclusive of both values) that is not highlighted and so would remain white.
Thank you Chandoo and Shelly for an interesting and useful exercise. This is certainly a valuable technique to have in my reporting bag of tricks.
Use of PERCENTILE is a smarter way of doing it. Below is my solution.
First 5 % = Apply conditional formatting (Dark Blue) as highlight ">=" =PERCENTILE(C:C,0.95)
Next 15% = Apply conditional formatting (Lighter Blue) as highlight between =PERCENTILE(C:C,0.95)-0.01 and =PERCENTILE(C:C,0.8)
Next 65% = Apply conditional formatting as highlight (Olive Green) between =PERCENTILE(C:C,0.8)-0.01 and =PERCENTILE(C:C,0.15)
Next 10% = Apply conditional formatting as highlight (Lighter Red) between =PERCENTILE(C:C,0.15)-0.01 and =PERCENTILE(C:C,0.05)
Bottom 5% = Apply conditional formatting (Red) as less than =PERCENTILE(C:C,0.05)
I agree, this is a challenge faced by HR managers every year and use of percentile formulae is the most popular solution which permits further processing like making bell curve, applying increments based on segmentation etc.
Hi Chandoo,
I came at the same solution as yours (not looking at yours first) but I have hard coded the conditions in the conditional formatting. For example:
=AND($C6>=$D$10,$C6<$D$9)
I have done the same thing 5 times for each condition. This makes the formatting independent of the order of specification. I think it will work better across versions of excel.
To copy the same thing in all sheets, Shelly can copy these formatted cells with format painter and apply it to the relevant cells in next sheet and so on! I know 700 sheets will be difficult but I dont know of any other way to apply conditional formating rules to the whole sheet.
First i have used percentile formula in the next column of "percentile Threshold" where E5, E6.. is input to colour code.
The idea behind doing this is to replicate the formula for any range and any threshold
=PERCENTILE($C$3:$C$30,1-E5)
=PERCENTILE($C$3:$C$30,1-E6)
=PERCENTILE($C$3:$C$30,1-E7)
=PERCENTILE($C$3:$C$30,1-E8)
=PERCENTILE($C$3:$C$30,1-E9)
Now i have given logic to different employee by applying "if Formula"
=+IF(J3>=$G$5,1,IF(J3>=$G$6,2,IF(J3>=$G$7,3,IF(J3>=$G$8,4,5))))
where 'J" referes to PR and "G" refers to percentile derived from above mentioned formula.
once again it is replicable (just change reference points)
Now comes the major part of Conditional Formatting, i have used "use a formula to determine which cells to be formatted"
Formula =$j=5, format "required colour" Applies to "$I$3:$J$30"
plus put tick on stop if true
This solves the query, important point that this is repeatable and can be done for n number of departments
Thanks !
I had done some reading on it and in Excel 2010 a new function has been introduced, percentile.exc. Attaching a video which also talks why the old percentile function shouldn't be used as it acts erroneous at times. Might be worth a watch Chandoo,
http://www.itechtalk.com/thread10579.html
@Deepa
Quit correct.
Where ever you use statistical spreadsheet functions and are using excel 2010 you should use the new versions of the functions as MS did a lot of work to speed up and fix errors in the old functions.
Warning: If you use the new Excel 2010 statistical functions in Named Formulas most of them will crash excel so do keep that in mind.
Hello Chandoo,
When i first read the challenge file, i thought, the color that need to be applied for a given rule, also need to be picked dynamically as given in rule set. But in the solution file, i found that color is hard Coded. So in case, someone has same data, but wants different colors, he/she needs to goto manage rules and change colors.
Let me know if my understanding is correct, and if yes, can we also make the color to be applied dynamic?
Thanks
Kishore
HI I ALSO USED THE PERCENTILE FUNCTION. HOWEVER, I WENT A STEP FURTHER AND USING THE SMALL() FUNCTION I SORTED THE DATA BY PERCENTILE SO THE COLOSCHEME WOULD BE GROUPED BASED ON THE VALUE. THIS WAY IT IS BETTER AND EASIER TO VIEW.
[...] recently posted a challenge to help a reader with a [...]
Hi, i have got doubt regarding to the percentages that has been put in chandoo's spreadsheet, i cant understadn how he put directly. can some one please explain how chandoo put the percetages straight way that i stated below..
5%
15%
60%
10%
5%
I have stumbled on this post as the solution has been already given so I have taken the liberty to record a video where I show the implementation of it as well as adding a filtering feature which I hope can prove to be useful.
Thank you
http://www.xlninja.com/2012/06/28/how-to-use-excel-to-highlight-employee-performance-rating/
[...] scriu nici macar un cuvant din urmatorul articol. Astazi mi-am citit mailul si hopa challenge de la Chandoo. Cum puteam sa refuz asa ceva si m-am apucat de citit, iar dupa 5 min i-am spus sotului ca pe asta [...]
Question for Chandoo:
I came to your site late but am totally loving these challenges 🙂
I guess it all boils down to how the bins are set up.
I agree with the PERCENTILE.INC function.
pls help me understand where I am wrong.
I have determined following the bins:
bottom 5% <=2.00 (F6:F33 <=PERCENTILE(range,.05))
lower 15% (5+10) <= 2.40 (F6:F33 <=PERCENTILE(range,.15))
lower 80% (5+10+65) <=3.46 (F6:F33 <=PERCENTILE(range,.80))
lower 95% (5+10+65+15) <=4.00 (F6:F33 =PERCENTILE(range,.95))
top 5% <=4.20 (F6:F33 <=PERCENTILE(range,1.00))
I find that only Tom is highest scorer and unique top 5% achiever.
I notice that Chandoo has included Christy and Daniel in top 5% achievers. How can there be 3 people in top 5% out of a population of 28 (5% of 28 = 1.4, i.e. only one person can achieve that status)?
I tried different ways but cannot get to that distribution.
Rest of the work is simply organizing the conditional formatting rules with Stop If True box checked.
Thanks for your insights