25 Excel Tips

Holiday gift eBook from Chandoo.org

Happy Holidays25 Excel TipsE-book from Chandoo.orgHi there,Thank you so much for getting a copy of the 25 Excel Tips book.What is in this book?We have 25 chapters in this book. Each chapter explains one tip or idea. To get maximum benefit from this book: Read one chapter at a time. Give time for the tips to sink in and apply them. Each chapter also has some links at the bottom denoted with star & question mark symbols. Click on these to learn more. Many chapters have additional material for you to download or watch. Use them to learn more.That is all. Go ahead and enjoy this book.Before you start,Yours,25 Excel TipsE-book from Chandoo.orgTable of Contents1. Debugging Formulas using F9 key2. Display decimal points when number is less than 13. Display symbols in Excel charts4. Use ALT+Enter to get multiple lines in a cell5. Checking whether a value is between 2 other values6. Comparing 2 lists Fast & Quick7. Converting text to sentence case8. Displaying alert symbols in dashboards9. How to speed-up formula entry with CTRL+Click10. Displaying Currency Symbols in Excel11. Finding 2ndLargest value matching a condition12. VLOOKUP several columns13. Using picture links014. Format Multiple Sheets15. Remove Blank Rows Quickly16. Format multiple charts17. Reverse a list of values18. Modify formulas using find replace19. Calculate elapsed time20. Awesome data labels21. Dynamic charts in 2 minutes22. Calculate moving average23. Using 3D references24. Five awesome mouse tips25. Filter even or odd rows26. Bonus: Keyboard shortcuts25 Excel TipsE-book from Chandoo.orgDebug formulas using F9 keyCan you imagine building a complex worksheet without formulas? I cant. While no onecan dispute the usability of formulas, we all know how painful it is when an excelformula returns a mysterious error and we dont know what is causing it.When I learned IF() formula for the first time, I have spent a whole Sunday morningdebugging a stupid error in a grade calculation formula.Assuming we have a moderately lengthy formula like this=IF(AVERAGE(B2:B6)<=AVERAGE(C2:C6),MAX(B2:B6),MAX(C2:C6)) and we wantto know where the error is occurring,1.Select the cell with formula.2.Now select the part of formula that you want to evaluate and press F93.This will evaluate only the selected part and replaces it with the result.4.Using this technique you can narrow down the errors to particular range or valuescausing it.5.When you are done, press ESC.1Select the portion of formulaPress F9 to evaluate itMore on Formula Errors ? Discuss this topic25 Excel TipsE-book from Chandoo.orgDisplay decimals when number is less than 1 Here is a quick excel number formatting tip. If you ever want to format numbers in such a way that it shows decimal values only if the number is less than 1 you can use conditional custom cell formatting (do not confuse with conditional formatting).See the example aside.In such cases you can use conditions in custom cell formatting. First select the numbers you want to format, hit CTRL+1 (or right mouse click > format cells) In the Number tab, select category as custom Now, write the formatting condition for custom formatting the cell. In our case the condition looks like [<1]_($#,##0.00_);_($#,##0_). See to the right. what it means is, if the cell value is less than 1 then format the cell in $#,##0.00 format otherwise format as $#,##0. Excel cell formatting is a tricky business and if you want to master it there is no better source than Peltiers article on Custom Number Formats.2More on Custom Cell Formatting ? Discuss this topic25 Excel TipsE-book from Chandoo.orgDisplay symbols in Excel chartsHere is a quick excel tip to make your charts look professional by showing symbols in the axis labels instead of text. Just follow these 4 simple steps: First identify the symbols you want to show on the axis or as data label from symbol fonts like webdings, wingdings or a custom dingbat font like company logos Now use this symbol characters as axis labels Finally change the font to the selected symbol font Really there is no 4th step, so go ahead add a little jazz to the chart. 3More on Axis Labels ? Discuss this topic25 Excel TipsE-book from Chandoo.orgUse ALT + Enter to get multiple linesIf you need to type content in a cell and you want to see it in multiple lines then use alt + enter to break the content in several lines.See the example on left.Bonus tip: If you are using formulas to create content in a cell by combining various text values and you want to introduce line breaks at certain points For eg. you are creating an address field by combining house number, street name, city and zip code and you want to introduce line breaks after house number and street name then you can use CHAR(10). Like this:=housenumber & CHAR(10) & streetname & CHAR(10) & city & zipcodeRemember when you do this, you need to enable wrap-text feature for that cell from cell formatting dialog (ctrl+1) to ensure proper display.4More on Formatting ? Discuss this topic25 Excel TipsE-book from Chandoo.orgChecking for between conditionsLets say you have 3 values in A1, A2 and A3. And you want to find out if A1 falls between A2 and A3. Now, the simplest formula for such a thing would be test whether the conditions A1>=A2, A1<=A3 are both true. Hence, it would look like,=if(AND(A1>=A2,A1<=A3),"Yes", "No")However, there are 2 problems with a formula like above: (1) It assumes that A2 is smaller than A3. (2) It is just too big.Shouldnt there be a shorter and simpler formula?!?Well, there is. Daniel Ferry, has come up with a darned clever use of MEDIAN formula to test this. It goes like, =if(A1=MEDIAN(A1:A3),"Yes","No")Now, not only does the above formula look elegant and simple, it also works whether A2 is smaller or larger than A3.Between Formulas in Excel Summary and Examples:5More on Formulas? Discuss this topic25 Excel TipsE-book from Chandoo.orgFast & Simple: Compare 2 ListsA Ridiculously easy and fun way to compare 2 lists[works only Excel 2007+, use the this technique if you are on excel 2003 or earlier]1. Select cells in both lists (select first list, then hold CTRL key and then select the second)2. Go to Conditional Formatting > Highlight Cells Rules > Duplicate Values3. Select Duplicate4. Press ok.See the screenshots aside to see how this works (click here for a detailed demo).6More on Conditional Formatting ? Discuss this topic1 2325 Excel TipsE-book from Chandoo.orgConvert Text to Sentence CaseExcel has formulas for converting a bunch of text to UPPER, lower and Proper Cases. But not a formula to convert o Sentence case. So, in this tip, we will learn a simple formula tip to convert text to sentence case (ie, First letter capital).Assuming your text is in C2, the formula is,=UPPER(LEFT(C2,1))&MID(LOWER(C2),2,999)How the formula works?It is converting first letter of C2 to upper case [UPPER(LEFT(C2,1))] and lower case of rest of C2 [MID(LOWER(C2),2,999)]The 999 portion is the secret code to unlock ninja features of MID formula.Well, I am kidding of course, the 999 is just a cop-out to say give me rest of the C2, I dont know the length of it. (of course, 999 would fail if your text actually has more than 1000 chars. In that case, just use 9999 or whatever large number you fancy.)Another formula:=SUBSTITUTE(LOWER(C2),CHAR(CODE(C2)),UPPER(CHAR(CODE(C2))),1)PS: As you can guess, the above formulas assume that C2 has one sentence. If C2 has a whole paragraph, then I would really need a sandwich before thinking about that problem.7? Discuss this topic More on Formulas25 Excel TipsE-book from Chandoo.orgUse Alerts in DashboardsDashboards can be overwhelming with lots of details and context. A simple way to drag users attention to important stuff in the dashboard is to use alerts. See this example to understand what alerts mean.How to display alerts in Excel Dashboards?The easiest way to display alerts is to use Excel 2007s Conditional Formattingfeature Icon sets.[Excel 2007+]Assuming you have a table in dashboard like shown aside 1. Select the alert column and go to Conditional Formatting > Icon sets > 3 Traffic Lights (unrimmed)2. Go to Conditional Formatting > Edit Rules3. check Icons in reverse order and Show icons only buttons and you are done!For Excel 2003 click here.8More on Dashboards ? Discuss this topic25 Excel TipsE-book from Chandoo.orgCTRL+Click speeds up formula entrySometimes we think there is very little we can improve in something and then we come across an idea that would change our perceptions. I have been writing excel formulas for such a long time that it was easier to remember when I first shaved than when I first wrote a formula. I want to present a very interesting functionality in Excel that would save a lot of time when you are entering formulas in spreadsheets.If we have 5 cells and we want to CONCATENATE all the text in them to one cell, we would usually write =CONCATENATE( and then start typing addresses of each cell one by one. But there is a faster and simpler way to do this. You can just hold the CTRL key down and select all the five cells one after another and excel will neatly type the references for you and include a comma to separate them. You can also use the same technique for speeding up formula entry for other multi-argument formulas like VLOOKUP, MATCH etc. Just select the cells corresponding to each parameter in that order while holding the CTRL key down.9? Discuss this topic More on using Mouse25 Excel TipsE-book from Chandoo.orgHow to Add Symbols like to Excel?Often, we need to input special symbols like in to our Excel sheets. Now, how do we do that?Simple, Use Insert > Symbol to add several different kinds of symbols.(see the demo)5 Bonus tips on using Symbols:1. You can just double click on the character to insert it. No need to press Insert button.2. You can quickly open insert symbol dialog by pressing ALT+I and then S. (related: 97 keyboard shortcuts to boost your excel mojo)3. You can use the symbols in formulas too. For eg. you can show ? or ? or ? based on change of one value wrt to another. Like this: =if(A1>A2, , if(A1<A2,,))4. Quickly access symbols to specific to currency, arrows or greek chars by using the drop-down at top-right.5. Change the font to Wingdings / Webdings to see some useful and fun characters. You can spice dashboards or reports with these.10Using Symbols in Charts ? Discuss this topic25 Excel TipsE-book from Chandoo.org2ndLargest Value Matching a ConditionExcel Array Formulas have subtle beauty and raw power. Lets use them to find-out the 2nd largest sale amount for a particular product.Lets say you have sales data as shown asideNow, we all know that, to get 2nd largest sale amount, we can use the LARGE() formula. Like this: =LARGE(RANGE,2)But, how do we know what is the 2nd largest sale amount for the product bricks?This is when an array formula can help you.Formula=LARGE(IF(PRODUCTS_RANGE="Bricks",SALES_RANGE,""),2)and press CTRL+SHIFT+ENTER.Explanation:Instead of directly giving the SALES_RANGE to LARGE formula, we are asking excel to include empty spaces wherever product <> Bricks thru the IF() formula inside LARGE().When you press CTRL+SHIFT+Enter, excel treats the formula as array formula and processes the lists of values inside nicely.11? Discuss this topic More on using MouseDownload Excel Workbook with Examples25 Excel TipsE-book from Chandoo.orgValues from Several Columns with VLOOKUPSituationVLOOKUP is great for extracting information from a huge data table based on what you are looking for. But what if you need to extract more than one column of information? For eg. Lets say you have salespersons name in left most column, and monthly sales figures in next columns, one for each month. Now, you want to find the total sales made by a given sales person. How do you go about it?Assuming your data looks like the table aside,SolutionSimple. You can use an array in the column number field of VLOOKUP. So for eg. =SUM(VLOOKUP(value, list, {2,3,4},false)) will give you sum of values in columns 2,3 and 4. Of course you must press CTRL+SHIFT+Enter after typing the formula. See few more examples in the box aside.12More on VLOOKUP Formula ? Discuss this topic Download Excel Workbook with Examples25 Excel TipsE-book from Chandoo.orgUsing Picture Links in ExcelIn this lesson, we will learn a new excel feature, called as Picture links.Well, picture links are not really new, they are called as camera snapshots in earlier versions. They provide a live snapshot of a range of cells to you in an image. So that you can move the image, resize it, position it wherever you want and when the source cells change, the picture gets updated, immediately.What is the use of Picture Links or Camera Snapshots?Here are few sample uses for picture links:In dashboards & reports: Usually in dashboards, we need to combine charts, tables of data, conditional formatting etc., all in one sheet. When the size of these are not uniform, aligning them on output sheet could be a huge pain. This is when you can use picture links. First create the individual portions of dashboard in separate worksheets. Then, embed picture links to these portions in final dashboard. Re-size them and align as you see fit. See this in action: Project management dashboard in excel. In micro-charts & sparklines: While Excel 2010 has native support for sparklines and other micro-charts, if you want to create a micro-chart in earlier versions of excel you have to use trickery. This is where picture links can help. You can make a regular chart and take a picture link of that. Then resize the picture so that it fits in to a small area. See this in action: Micro-charts using camera tool.In Dynamic Charts: Since picture links are nothing but images with a formula assigned to them, you can easily construct dynamic charts & dynamic dashboards using these. See this in action: Dynamic chart using camera tool, Dynamic dashboard using camera toolIn shared workbooks: When you share a workbook with a colleague or boss, a common worry is what if they change formulas or edit something. This is where picture links can be of great use. You can embed a picture link of actual data so that no one can edit it.Contd. in next page,1325 Excel TipsE-book from Chandoo.orgUsing Picture Links in ExcelHow to insert a picture link in Excel 3 step tutorial:To insert a picture link to your data, just follow these 3 steps: Select the cells. Press CTRL+C Go to a target cell. From home ribbon select Paste > As picture > Picture link option (see image below) That is all. Your picture link is live. Move it or play with it by changing source cells.13? Discuss this topic More on Picture Links25 Excel TipsE-book from Chandoo.orgFormat Multiple Sheets by GroupingOften we come across workbooks that have similar formatting needs for multiple worksheets. For eg. you may have sales records spanning across 12 worksheets, one for each month. And you want to keep the formatting of all these worksheets consistent. So here is a quick tip to begin your work week. 1. Just select all the different sheets (select one, then hold CTRL key and click on other sheet names).2. Now format any sheet and similar formatting will be applied to all selected sheets3. See this demo to understandThe group & format technique is particularly useful when you, Want to apply same header / footer / print settings to multiple worksheets Want to write similar formulas in multiple worksheets (for eg. totals)CAUTION: Turn-off the grouping by selecting any one sheet tab after formatting. Otherwise, any changes you make will be applied to all sheets.14? Discuss this topic More on Formatting25 Excel TipsE-book from Chandoo.orgRemove Blank Rows QuicklyBlank rows or Blank cells is a problem we all inherit one time or another. This is very common when you try to import data from somewhere else (like a text file or a CSV file). Use this procedure to remove blank rows quickly, Select your data, Press F5 This opens Go to dialog in Excel. Now hit on that select button. From select special screen, select Blanks (shown aside)Now, all the blank cells will be selected. Just press CTRL and Minus sign (-) Select shift cells up or entire row as needed. That is all. Now you have successfully removed blank rows.Bonus tip Keyboard shortcut to remove blank rows:Press these keys in the same order once you select the cells. F5 ALT+s k Enter CTRL+ u Enter15Video Tutorial of this ? Discuss this topicWatch this tutorial on25 Excel TipsE-book from Chandoo.orgFormat Multiple Charts QuicklyWhen we have multiple charts, ensuring consistent color schemes, fonts etc. is very important. Often we individually format the charts because they have different chart types or source data. But instead, you can just use paste special to copy and paste chart formatting (formatting of labels, grid line settings, axis settings, colors, legends, titles) from one chart to another. See the illustration aside. To do this, Select the source chart, press Copy (or CTRL+C) Now select the destination chart, go to Paste Special (or press ALT+ES). From the dialog select Formats.16? Discuss this topic More on FormattingWatchAnimated DemoOf This Tip25 Excel TipsE-book from Chandoo.orgReverse a List of ValuesHere is a simple yet novel use of formulas.Let us say you have a list of values in range A1:A5 and you want to reverse the list.In an empty cell write =INDEX($A$1:$A$5,COUNTA($A$1:$A$5)-ROWS($A$1:A1)+1) and copy down. Boom, you get the reversed list.Here is how the formula works: In the reversed list, first item is last item in the original list (ie 5th item in our case). INDEX() formula takes a list, a row number (and optional column number) and returns the value at intersection. In this case, $A$1:$A$5 is the list. 5 is the size of list. ROWS($A$1:A1) gives running numbers from 1 thru 5 when copied in any range of 5 cells. Read more on using ROWS() formula.17More tips on INDEX formula ? Discuss this topicDownloadExampleExcel Workbook25 Excel TipsE-book from Chandoo.orgModify Formulas using Find / ReplaceSo you have built that spreadsheet report your boss wanted. And you were all eager to use it in your presentation. But in the last minute, your boss asked you to change average sales to total sales figures (or measure growth wrt to 2006 instead of 2007). You also want to grab an espresso before rushing to the meeting. Now what?Simple, skip the coffee. Of course, I am kidding, who would skip coffee for a bunch of formulas ? So, we use Find / Replace to do the dirty work while we let the roasted beans restore sanity. Just press Ctrl+` (it is the key next to 1), this will enable formula view. Now press Ctrl+H and change the spreadsheet formulas or input range en masse.You can also use find / replace to change spreadsheet formatting.18? Discuss this topic More on Find Replace25 Excel TipsE-book from Chandoo.orgCalculate Elapsed TimeElapsed time is nothing but interval between a starting point and the current point in time. We can use excel formulas to calculate elapsed time very easily.For all the examples in this, the starting date-time is in Cell A1.Calculating elapsed time in years=(NOW()-A1)/365 [Help on NOW formula]Elapsed time in months=(NOW()-A1)/30. This returns the value in 30 day months.Elapsed time in weeks=(NOW()-A1)/7Elapsed time in days=TODAY()-A1. [Help on TODAY formula]Elapsed time in working daysTo calculate elapsed time in working days, we can use the NETWORKDAYS formulaThis formula assumes 5 working days per week starting with Monday. Elapsed time in hours=(NOW()-A1)*2419Working with Date & Time ? Discuss this topicDownloadExampleExcel WorkbookRefer to download workbook for more examples25 Excel TipsE-book from Chandoo.orgAwesome Data LabelsWe all know that Chart Data Labels help us highlight important data points.When you add data labels to a chart series, excel can show either category , series or data point values as data labels. But what if you want to have a data label that is altogether different (see pic. 1).You can change data labels and point them to different cells using this little trick. First add data labels to the chart (Layout Ribbon > Data Labels) Define the new data label values in a bunch of cells (see pic 2). Now, click on any data label. This will select all data labels. Now click once again. At this point excel will select only one data label. Go to Formula bar, press = and point to the cell where the data label for that chart data point is defined. Repeat the process for all other data labels, one after another. See the screencast.Points to note: This approach works for one data label at a time.. Try Rob Boveys Chart Labeler Excel Add-in. This free tool can automate the whole custom chart labeling for you.20? Discuss this topicMore on Chart FormattingWatchAnimated DemoOf This Tip1225 Excel TipsE-book from Chandoo.orgCreate a Dynamic Chart in 2 MinutesHere is a dead simple way to create a Dynamic Chart in Excel in less than 2 minutes.First take a look at the dynamic charts in excel demo.Just follow these 5 steps to create the dynamic chart in excel:1. Prepare your charts: Make as many charts as you want. Lets say 3.2. Set up the area where dynamic charts will be loaded: Just take 3 cells in a row and adjust the row height and column width such that the charts can be fit inside snugly. Also, type the chart names (1 for each cell) in the cell. Let us say, the charts you have are for Costs, Sales and Profits, just type these names in the cells.3. Move and fit charts inside these cells: This should be simple.4. Finally apply data filter to the cell on top of the 3 cells. Select a filter option and you will see only that chart.21More on Dynamic Excel Charts ? Discuss this topicWatchAnimated DemoOf This Tip25 Excel TipsE-book from Chandoo.orgMoving average is frequently used to understand underlying trends and helps in forecasting. Calculate Moving AverageTo calculate moving average, all you need is the good old AVERAGE excel function.Assuming your data is in the range B1:B12,Just enter this formula in the cell D3 =AVERAGE(B1:B3)And now copy the formula from D3 to the range D4 to D12 (since you are calculating moving average of 3 months, you will only get 10 values; 12-3+1)Calculate Moving Average of Latest 3 Months AloneLets say you need to calculate the average of last 3 months at any point of time. Formula:=AVERAGE(OFFSET(B4,COUNT(B4:B33)-3,0,3,1))Explanation:We are counting the number of months with COUNT(B4:B33) and then getting data for 3 last months using OFFSET(B4,COUNT(B4:B33)-3,0,3,1). Finally we are passing this range to AVERAGE function to calculate the moving average of latest 3 months.22? Discuss this topic More on OFFSET FormulaCalculate Moving Average25 Excel TipsE-book from Chandoo.orgExcel 3D References What are they?No, dont fetch your 3D glasses. 3D references are your way to refer to same cell in multiple sheets. Confused ? See this illustration:So we can use 3D references to compute the average of cell D5 across various worksheets. Assuming the sheets are arranged such that we have Shellys sheet first and Zacks sheet in the end, the formula will look like, =average(Shelly:Zack!D5)23? Discuss this topicSee 3D References in Action 25 Excel TipsE-book from Chandoo.org5 Awesome Mouse Tips!When it comes to productivity, many of us think of keyboard shortcuts. But you can also boost productivity a lot by using mouse. That is right. See this list of 5 tips.24More Mouse Shortcuts ? Discuss this topicWatch Animated Demo Of These Tips12345Double click on Office button / Logo to close ExcelAdjust column widths & row heights by double clicking on the separatorsDouble click in the corner, just above scrollbar to include a splitDouble click on ribbon menu names to collapse ribbon to get more spaceIn MS Office 2007 or above you can double click on the ribbon menus to collapse the ribbon to one line.Auto-fill a series of cells with data or formulas by just double clickingI have saved countless minutes ever since I learned this little trick. Lets say you have a table where in one column you have some data and in the next you have written a formula in the first row. Now just select the formula in first cell, double click in the bottom right corner and see the magic.You can create a vertical split by clicking on the little bar shape next to horizontal scroll-bar near bottom right corner of the excel window.(If you are wondering where the split would be created, it will be created at selected cells row (or column))23525 Excel TipsE-book from Chandoo.orgSometimes, we may need to filter only even or odd rows, as shown aside. Just follow the below 5 steps to do this.1. Add an extra column at the end of your data.2. Type =ISEVEN(B3) to test whether the number in B3 is even or odd.3. Drag the formula to fill the entire range.4. Now filter either TRUE or FALSE values.5. That is all. You have filtered even or odd rows.Bonus tips: You can filter every third row using =MOD(B3,3) and then filtering out all 0s. Help on MOD formula. You can highlight alternative rows in different colors using conditional formatting. Or use Excel Tables to automatically zebra-line (ie shade alternative rows in different color).25? Discuss this topic More on using Data FiltersFilter Even or Odd Rows Only!WatchAnimated DemoOf This Tip25 Excel TipsE-book from Chandoo.org25 Bonus Tips Important Shortcuts 26-50Shortcut What it does?CTRL + SPACESelect the whole column (SHIFT+SPACE for row)CTRL + *Select a continuous range of data, no matter where your cursor stands in the arrayCTRL + SHIFT + {Select all cells that are directly or indirectly referred to by formulas in the selectionF4Change the type of cell reference from relative to absolute or semi-absoluteF4During non-formula editing mode, Repeats whatever you did last.F3Display range names (can be used when typing formulas)ALT + TUFEvaluate formulas. (its easy to remember when working with some tuf formulas!)CTRL + ' Copy a formula from above cell and editCTRL + ADisplay the formula palette after you type a valid function name in a formulaCTRL + ` Alternate between displaying cell values and displaying cell formulasShortcut What it does?CTRL + [ Select all precedent cellsCTRL + 1 Format Selection (cells, objects, charts)CTRL + SHIFT + 1 Format as number with 2 decimal pointsCTRL + 9 Hide row (CTRL+0 for column)CTRL + 5 Sets/removes strikeout in current cellCTRL + SHIFT + 7 Single border around selected cellsCTRL + K Insert hyperlinkALT + WFF Freeze panesALT + HW (2007+) To wrap linesF12 Save asCTRL + F1 Collapse the ribbon (press again to expand)ALT + DFS Keep filter on columns, but show all rowsCTRL + SHIFT + L Turn filter on or offALT + ESV Paste values onlyF5 + ALT + SK,ENTERSelect blank cells97 More Keyboard Shortcuts25 Excel TipsE-book from Chandoo.orgYours,Hi dear,Thank you for picking up 25 Excel Tips e-book from Chandoo.org. Clearly, you are intelligent and eager to learn. I bet you are kind, passionate and help others too. Now that you have finished reading this book, I have a small favor to ask: Can you share this book? Please email this book to a colleague or friend. I am sure they deserve to be as awesome as you are.Other ways to share: Send them to this page http://chandoo.org/wp/special-gift/ Post about this book on Facebook Share with your friends via TwitterCan I ask you a favor?