Excel Tips
Excel Tips
Excel Tips
7 PUBLISHING AN EXCEL WORKBOOK TO AN INTRANET/INTERNET LOCATION ............................................ 8 SPLITTING OF WINDOWS ....................................................................................................... 10 MULTIPLE DATA CONSOLIDATIONS FOR PIVOT TABLES .................................................................... 12 TEXT CONVERSIONS ............................................................................................................. 14 TEXT LENGTHS IN EXCEL ....................................................................................................... 16 EXCEL TIP ERROR TRAPPING ................................................................................................... 18 CUSTOMIZING RIBBONS ......................................................................................................... 20 PERSONAL MACRO CUSTOM FORMAT ......................................................................................... 22 TEXT FUNCTION IN EXCEL ...................................................................................................... 24 MAIL MERGE ...................................................................................................................... 26 NEGATIVE DATA BARS ........................................................................................................... 28 MANDATORY CELL INPUT ....................................................................................................... 30 REMOVING DUPLICATES ........................................................................................................ 32 SOLVER (RECOVERED) .......................................................................................................... 34 DATABASE FUNCTIONS .......................................................................................................... 39 SUBTOTAL ........................................................................................................................ 41 PIVOTTABLE ...................................................................................................................... 43 PIVOTTABLE CALCULATED FIELDS ............................................................................................ 46 USING VALUE FIELD SETTINGS IN PIVOTTABLES ............................................................................ 48 CONDITIONAL FORMATTING ................................................................................................... 50 DATA VALIDATION ............................................................................................................... 53 EXCEL FILE FORMATS ........................................................................................................... 55 RANK FUNCTION ................................................................................................................. 57 PV FUNCTION ..................................................................................................................... 59 TWO CHART TYPES .............................................................................................................. 61 WORKDAYS........................................................................................................................ 64 TRENDS ............................................................................................................................ 66 AGGREGATE FUNCTION ......................................................................................................... 68 SUBTOTAL COMMAND ........................................................................................................... 71 EXCEL WEB QUERY .............................................................................................................. 73 SUBTOTAL VISIBLE CELLS ...................................................................................................... 75 FUTURE DATES PROJECTION................................................................................................... 77 KEYBOARD SHORTCUTS TO ACCESS THE RIBBON PROGRAMS ............................................................ 78 DATE DATA VALIDATION ........................................................................................................ 80 GETPIVOTDATA .................................................................................................................. 82
DATA VALIDATION WITH FORMULA ........................................................................................... 84 IF FUNCTION ..................................................................................................................... 86 HLOOKUP ......................................................................................................................... 88 CREATING THE SLICER CONNECTION TO SECOND PIVOTTABLE .......................................................... 90 AUTO GENERATION OF NAMES ................................................................................................ 92 CREATING A 3D REFERENCE NAME ............................................................................................ 94 LARGE FUNCTION ................................................................................................................ 96 TRIM FUNCTION .................................................................................................................. 97 SMALL FUNCTION ................................................................................................................ 99 MODE FUNCTION ................................................................................................................ 100 TRANSPOSE OPTION ............................................................................................................ 101 REPT FUNCTION ................................................................................................................ 103
Tip 1
4. Select the arrow and a drop down menu will open. You can then filter on your Date field, by selecting the Data filter option from the drop down menu. Open the dropdown. Choose Date Filters. The next flyout menu offers filters for This Week, Next Month, Last Quarter and others. If you want to filter to a specific month or quarter, choose All Dates in Period and select a month or quarter from the final flyout menu. See the example below.
Tip 2
The unit argument can also be a combination of days, months, and years: "YM" - excludes years - calculates the number of months between two dates as if the dates were in the same year. "YD" - excludes years - calculates the number of days between two dates as if the dates were in the same year. "MD" - excludes months - calculates the number of days between two dates as if the dates were in the same month and year.
Calculate the Number of Days Between Dates Example Note: Commas are used as separators between the function's three arguments. For help with this example, see the image below
1. Enter the following dates into cells C2 and D2: 1/30/2010 and 5/18/2010 2. Click on cell E1 in the spreadsheet - this is where the function will be located
3. Type " = datedif " in cell E1 4. Type an opening round bracket " ( " after the function name in cell E1 5. Click on cell C2 in the spreadsheet to enter the cell reference of the start_date into the function 6. Type a comma ( , ) in cell E1 after C2 to act as a separator between the two cell references in the function 7. Click on cell D2 in the spreadsheet to enter the cell reference of the end_date into the function after the first comma 8. Type a second comma ( , ) in cell E1 following the second cell reference as a second separator 9. For the unit argument, type the letter D in quotes ("D" ) in cell E1 after the second comma to tell the function we want to know the number of days between the two dates 10. Type the closing bracket " ) " 11. Press the ENTER key on the keyboard 12. The answer 108 should appear in cell E1 as there are 108 days between January 30th and May 18
You can follow the same process for the remaining dates If you get a #NUM! error in the cell where your function is located, it means that the start_date is larger (later in the year) than the end_date
Tip 3
2. To extract the initials from the right select D3 and type =Right (C3,1) and press enter 3. Copy the formula down and the screen below will be displayed.
As can be seen above the initials have been extracted from the right hence one can analyze the data further based on the initials.
Tip 4
2. 3. 4.
To save click on the office icon/File menu Select Save As, and enter income statement as the file name Under the file extension select web page. Refer to the screen shot below
5.
6. 7. 8. 9.
Select the auto republish every time this workbook is saved option Select the open published workbook in browser option Click the publish button Due to some security restrictions on some browsers, the option to allow the content to be displayed should be selected.
The financial statement will then be displayed on the website in a static format. Hence no changes can be made to the Data. Furthermore when the source workbook is saved the data will be republished to the intranet/server.
Tip 5
Splitting of Windows
Question: Is it possible to view different parts of the data worksheet at the same time? For instance when I import the payroll summary report from the payroll system, I would like to see the top ten & bottom ten earners. We have over five hundred employees on our payroll and this analysis is crucial in identifying the trends in our payroll. Answer: Yes, with split panes option. A very handy feature of Excel is its ability to allow you view more than one copy of your worksheet, and for you to be able to scroll through each pane of your worksheet independently. You can do this by using a feature called Split Panes, which will allow you to split your worksheet both horizontally and vertically. When you split panes, the panes of your worksheet work simultaneously. If you make a change in one, it will simultaneously appear in the other. If you wish to move the split, just place your mouse over it, hold down your left mouse button and drag to where you want it. To get rid of the split, just double click it, or go to Window>Remove Split
Why:
In order to effectively analyze a huge list of data by viewing different parts of the worksheet simultaneously
Applies To: Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000 1. Open or create the desired spreadsheet, for instance payroll summary report 2. To split panes, point to the split box at the top of the vertical scroll bar or at the right end of the horizontal scroll bar for a vertical split
or
4. To remove the split, double-click any part of the split bar that divides the panes 5. Alternatively select the view tab under the windows group then click on split - (Excel 2007 & 2010). For Excel 2003, XP and 2000 click on the windows menu and select split. Refer to the screen shots below
One is therefore able to view different parts of the worksheets simultaneously and make informed decisions
Tip 6
Applies To: Excel 2010, 2007, 2003, XP, 2000, 97 1. Enter the data given below in the three worksheets; sheet 1, sheet 2 and sheet 3 respectively. Sheet 1
Sheet 2
Sheet 3
2. 3. 4. 5.
Insert/Select sheet 4 For Excel 2007 and 2010 press ALT + D and then press/type P For Excel 2003, XP, 2000 and 97; click the Data menu and then PivotTable & PivotChart Report The screen shot below will be displayed
6. 7.
Select Multiple consolidation ranges and PivotTable then click Next Select create a single page field for me and then click next. The screen shot below will be displayed.
Red arrow
8. 9. 10. 11.
Click on the red arrow under Range and select the data range A1:B9 on sheet 1 Press Enter and click the add button Repeat steps 8 & 9 for data on sheet 2 and sheet 3 Click on the next button and select Existing Worksheet then click Finish
As you can see a PivotTable with a multiple data consolidation range has been created. One can easily select the data to be displayed by selecting the appropriate option. The page option allows a user to select data for the respective worksheet. The worksheets are given as item 1, Item 2 and Item 3.
Tip 7
Text Conversions
Question: I usually export my inventory data into Excel for further analysis. However the products names appear in upper case when I do this. Is there a way of converting the product names to lowercase and then capitalizing each word how do I do this in Excel? Answer: By using the proper function Why: To convert the text of data into proper case (Capitalize each word)
Applies To: Excel 2010, 2007, 2003, XP, 2000, 97 1. Given that you have the data below
2. 3. 4.
Select cell E4 and type; =proper (D4) Press Enter and copy the formula down The result will be the screen shot below
The products names are now in proper case. This has been achieved by using one function and the products names are now formatted correctly.
Tip 8
1.
Assuming that you want to count the text length for the products given below
2. 3. 4. 5.
Select cell D4 and type =Len(C4) Press the Enter key and copy the formula down Select cell D22 and type =Max(D4:D21) The screen shot below will be displayed
One is able to specify the correct field size (31) for the product names when designing the table in the database. Thus there will be no incomplete data through truncations when the stock list is exported to the database program.
Tip 9
Applies To (Excel 2007 and 2010): 1. Create the spreadsheet as in the example below
2. 3.
Select cell G5 and type =-(E5-F5)/E5. Press Enter and auto-fill the formula down The screen shot below with #DIV/0! Error messages will be displayed. The variance figures have been converted to percentage
4.
=IFERROR(-(E5-F5)/E5,"Target not given") 5. The screen shot below will be displayed. As you can see the variance has no error messages displayed. Instead a custom error message is given which gives credibility to the data
Tip 10
Customizing Ribbons
Question: I find it tiresome switching between ribbons in Excel 2010 when I am creating reports. Is there a way of customizing a ribbon so that I can group all the frequently used functions together? Answer: Yes, by creating a custom ribbon in Excel 2010 In fact, to make your reporting easier, Alchemex has created a customized BI ribbon which you can download for FREE here and follow the easy instructions to install Why: To group all the frequently used functions together
Applies To MS Excel 2010: 1. Click on the file menu and select options. The screen shot below will be displayed.
Customize ribbon
New Tab
2. 3. 4. 5.
Select Customize Ribbon as given above Click on New Tab as given above Rename the ribbon to Alchemex by clicking on the Rename button The screen shot below will be displayed
Rename
Popular Command
Add Button
6. 7. 8.
Under Popular Commands select the respective icons and click on the Add button To organize the custom ribbon in groups click on the New Group command and repeat step 6 Repeat steps 6 & 7 until the new ribbon has been created. Thereafter click the Ok button
A new custom Alchemex Ribbon will appear on the Excel ribbon. The commonly used functions will thus be placed in one group. The user will be able to easily access those functions and eventually will save on time.
Tip 11
Applies To: Excel 2000, XP, 2003, 2007 and 2010 1. Enter the data as given in the example below
2. For Excel 2007 & 2010 click on the View ribbon and then Macros-Record, New Macro. For Other versions of Excel Click on Tools-Macro-Record, New Macros 3. Make changes as given below
4.
Click Ok and select the relative reference button. (This enables the macro to run in any location within the worksheet) For Excel 2007 & 2010 click View-Macros-Use Relative Reference. Other versions of Excel click on the relative reference icon as given below.
Relative Reference
5.
Right click in any cell. Select format cells and make changes as given below
6. 7. 9. 10.
Click ok; select the relative reference button again Excel 2007 & 2010- select View-Macros-Stop recording and lower versions of Excel -Tools-Macro-Stop Recording Open the target workbook and highlight the respective employee numbers Excel 2007 & 2010- select View-Macros-View Macros and lower versions of Excel -Tools-Macro-Macros. The screen shot below will be displayed 11. Click on the drop arrow next to macros in and select Personal.XLSB, select the Employee Numbers macro and click the run button
The EmployeeNumbers macro will run in any workbook and apply the custom number format. In that way the process of applying custom number formats in the workbooks is automated.
Tip 12
Applies To MS Excel 2003, 2007, 2010 1. Refer to the data in the Excel worksheet as given in the example below
2. 3. 4. 5.
Select C3 Type;=Text(C3,MMMM) Press enter and copy the formula down The result will be as in the screen shot below
You can also use the following formula if you would like a shorter text format. Type;=Text(C3,MMM) This would give the result Jan, Feb, Mar for example. As can be seen above the name of the months have been extracted. Analysis in terms of how much sales were made in each month can easily be done now.
Tip13
Mail Merge
Question: How can one merge MS Excel with MS word given that we have a list of clients stored in MS Excel? Are we able to automate the sending of statements to clients? Answer: Yes, by merging MS Excel with MS word Why: To automate the sending of documents by merging MS Excel with MS Word
Applies To: MS Excel 2003, 2007, 2010 1. Refer to the data as given in the example below
2.
3.
For MS Word 2007 & 2010 click on the mailings tab and select start mail merge (in the select mail merge group) then step by step mail merge wizard For MS Word 2003 and lower; click on the tools menu, letters & mailings then mail merge Click next on the bottom right hand side until you reach step 3 Select the browse option
4. 5. 6.
7. 8.
Locate your MS Excel client database and click Ok twice For MS Word 2007 & 2010 select the cell below customer name in the statement template and click on insert merge field (under the write & insert fields groups)
From the field list select customer name Repeat steps 8-9 until you have inserted all the merge fields For MS Word 2003 & lower; click tools letters & mailings-show mail merge toolbar On the mail merge toolbar locate the insert merge field icon (next to insert word field) and repeat steps 8-9 Click the next button until you reach step 6 You can then print or edit the individual letters
The number of letters/statements that will be created will be equal to the number of clients in the database. In that way the process of sending documents to clients will be automated. Meaning an organization with a lot of clients is able to effectively & efficiently send mass mails to its clients.
Tip 14
Applies To MS Excel 2010: 1. The screen shot given below has negative & positive stock in/out values
2. 3. 4. 5. 6.
Highlight the stock in/out values Select conditional formatting under the home tab Select data bars Select the data bar of your choice The data bars below will be displayed
7. 8. 9.
To customize your data bars Repeat steps 3&4 and then select More rules Refer to the screen shot below
You can then customize the data bars, negative values and axis. Data bars for negative and positive values have been created. One is then able to easily analyze and interpret the data in Ms Excel 2010 by using conditional formatting and assigning rules to the conditional formatting.
Tip 15
Applies to MS Excel 2003, 2007, 2010: (Hint: Your Macro Security settings need to be enabled) Example: Make cell B3 mandatory for completion in a workbook.
Refer to the steps given below 1. Open Excel 2. Press Alt + F11 to open VBA for Excel 3. Double click on this workbook on the drop down list
4. If the above option is not available then; select viewproject explorer, and youll be able to proceed with the below steps 5. On your top right hand side select the first drop down arrow and choose workbook as given below 6. Select the second drop down arrow and choose BeforeSave as displayed below
7. Enter the following code If Cells(3, 2).Value = "" Then MsgBox "Cell B3 requires user input" Cancel = True End If 8. Save the Macro 9. To return to Excel press ALT + Q
10. Save the workbook (For Excel 2007 and Excel 2010 save workbook as a .xlsm) 11. When you save the workbook it will prompt you to fill in B3 before saving
This tip will only work when one tries to save. Meaning the workbook wont be saved as long as cell B3 is empty. By so doing cell B3 is now a mandatory cell. Important information such as employee names will thus be entered resulting in forms being completed. You may have to check your macro security settings should the tip not work.
Tip 16
Removing Duplicates
Question: Is there an automated way of deleting duplicate data rows from a worksheet? Answer: Yes, by using remove duplicates data tool Why: To remove duplicate values from a worksheet
Applies To: MS Excel 2007 & 2010 With reference to the data given below staff codes, P1, P2 and P7 have duplicate values
2. 3.
Highlight the data table. You may include/exclude the heading row Select the Data tab and Select Remove Duplicates under the Data Tools group. Refer to the image below
4.
5. 6.
In order to delete duplicate values at least one column that contain duplicates must be selected Select OK, and refer to the dialogue box below. Thereafter select OK again
The duplicate data rows have been deleted from the worksheet. The user will therefore not locate and delete the duplicate values manually, and this will result in time saving.
Tip 17
Solver (Recovered)
Question: I acquired a loan of $20,000. The repayment period is 3 years at 10% per annum. Is there a way to work out the current repayment? I can afford to pay $1000 per month and would like to know the new repayment period too . Answer: By first using the Payment function, and then using the solver option one can find a solution Why: To calculate the new repayment period for a loan amount
Applies To: MS Excel 2003, 2007 & 2010 1. Using the example given above, create a worksheet as per the screen below
2. Work out the current installment using the payment function. Select cell C7, (Monthly Payment), and type: =PMT(C6/12,C5,-C4) 3. Calculates the payment for a loan based on constant payments and a constant interest rate 4. PMT(rate, nper, pv, [fv], [type]) Rate Required. The interest rate for the loan Nper Required. The total number of payments for the loan Pv Required. The present value or the total amount that a series of future payments is worth now; also known as the principal Fv Optional. The future value or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0. Type Optional. The number 0 (zero) or 1 and indicates when payments are due 5. The answer will be $645.34 6. Now select Solver under Data What If Analysis- Data tools group 7. If the solver option is not installed select the link below for instructions on how to add the solver http://www.alchemex.com/Resources/EOS%20Previous%20Tips%20And%20Tricks/Solver%20Add in.pdf 8. when you add the solver option select as given below
10. Select the Add button and effect the changes below
11. Select OK 12. Select the Solve button and refer to the screen shot below
13. Select OK The new repayment period will be 22 months. Thus one can easily calculate how long it will take to settle a loan amount based on new variables. The interest rate is envisaged not to exceed 15% in the stipulated period. The answer, sensitivity and limits reports have also been generated to the left of the active worksheet.
Tip 18
DataBase Functions
Question: I have a list of product sales with different transaction dates. How do I calculate the total sales for transactions between 2009/03/20 and 2009/03/30 by using one formula? Answer: By using the DSUM function (Adds the numbers in a field (column) of records in a list or database that match conditions that you specify) Why: To calculate the total sales for products, for given a criteria range
Applies To: MS Excel 2003, 2007 & 2010 1. Using the Excel worksheet below
2. 2 3. 4.
You must use copy and paste to enter the data labels in H4 & I4 Use the DSUM function DSUM(database, field, criteria) Select cell I8 and enter: =DSUM(B4:F23,5,H4:I5) The answer will be $2,271.50
By using one formula the total sales for transactions between 2009/03/20 & 2009/03/30 have been easily calculated. This demonstrates the power of database functions like DSUM.
More on the Database function The DSUM function syntax has the following arguments: Database Required. The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. Field Required. Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. Criteria Required. Is the range of cells that contains the conditions that you specify? You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.
Tip 19
Subtotal
Question: I have a long data list of products & selling prices stored in an Excel sheet. Is it possible to have a breakdown of subtotals for each product category? Answer: Yes; by using the subtotal option in Excel Why: To automatically insert subtotals and totals for the selected cells
Important: The Subtotal command will appear grayed out if you are working with a Microsoft Excel table. To add subtotals in a table, you must first convert the table to a normal range of data, and then add the subtotal. Note that this will remove all table functionality from the data except table formatting. Applies: To MS Excel 2003, 2007 & 2010 1. Refer to the screen shot in the example below
2. 3.
The list must be sorted by category names for the subtotal option to be effective Select any cell within the data list and select data-subtotal as given below
4.
5. 6. 7.
Select the options as given above Select OK The data given below will be displayed
As can be seen above the data has been grouped by the category names whose subtotals for product sales are displayed.
Tip 20
PivotTable
Question: How do I create an interactive report that can quickly be used to summarize large amounts of data? Answer: By using a Pivot Table Why: A PivotTable report is useful to summarize, analyze, explore, and present summary data. A PivotTable enables you to make informed decisions about critical data in your enterprise. Applies To MS Excel 2003, 2007, 2010 1. Refer to the data as given in the example below
2. 3. 4. 5.
Select any cell in the list From the insert tab, in the tables group, select pivot table and click Ok Drag the category name and product name fields to the row labels area Drag the quantity, unit price and product sales fields to the values area as given below
6. 7.
To display data for the products under the sea food category; select the drop down arrow under row labels and select sea food as below. The following pivot table will be given
The data given in step 1 above can be summarized and queried in many user friendly ways. The Design of a PivotTable allows you to: Querying large amounts of data in many user-friendly ways. Subtotaling and aggregating numeric data, summarizing data by categories and subcategories, and creating custom calculations and formulas. Expanding and collapsing levels of data to focus your results, and drilling down to details from the summary data for areas of interest to you. Moving rows to columns or columns to rows (or "pivoting") to see different summaries of the source data. Filtering, sorting, grouping, and conditionally formatting the most useful and interesting subset of data to enable you to focus on the information that you want. Presenting concise, attractive, and annotated online or printed reports. Notes: How a PivotTable Field List Works
1. 2. 3. 4. 5.
Data Source (Excel, Cube, Database) Report Filter (Department) Column Label Area (Branch) Row Label Area (Customer Name) Values Area (Sales amount)
Tip 21
Applies To MS Excel 2003, 2007, 2010 1. This example is based on last weeks tip on how to create a pivotTable. The link is given below; Creating a PivotTable 2. Select any cell in the PivotTable
3.
Excel 2007
Excel 2010
The Insert a Calculated field window will open. Enter the following and select add
5.
Rename the field on the PivotTable to Markup (double click on sum of Markup field, delete the words sum
of and press enter) 6. 7. Repeat the Process to calculate Profit Enter the following and select add
8. 9. 10.
Select Ok Rename the field on the PivotTable to Profit The result will be as given below
The Markup and Profit figures have been computed by way of adding two calculated fields to the PivotTable.
Tip 22
Applies To MS Excel 2003, 2007, 2010 1. 2. For an example on how to create pivot tables refer to the link given below; Creating a Pivot Table. Select any cell in the PivotTable as given in the above example
3.
If the Pivot Table field list is not displayed select field list button on the Options tab in Excel.
4.
Add the product Sales column to the values area again. Refer to the screen shot given below
5.
Change the Sum of Product Sales2 field to a %; (a) Right click on the field Sum of Product Sales 2 in the pivot table (b)Select values field setting and select as below
5.
The analysis of sales by percentage and values can thus be performed.One can easily compare the sales of the various products by looking at the percentage column for the product sales. You can now change the name of the Fields to be more appropriate. I.e. Sum of Product Sales = Product Sales Total; Sum of Product Sales2 = % of Total Sales
Tip 23
Conditional Formatting
Question: In Excel 2010, is there a way to automatically highlight upcoming and past due dates? For example, I have dates that stock will expire in a spreadsheet. I would like Excel to highlight the ones that have expired and those that are 30 days from expiration in green. Is that possible? Answer: Yes, you can use conditional formatting to achieve exactly what you are looking for First highlight the range of cells that you want to apply the formatting to. In this example, we've selected all of the dates in Column B Select the Home tab in the toolbar at the top of the screen. Then in the Styles group, click on the Conditional Formatting drop-down and select Manage Rules.
When the Conditional Formatting Rules Manager window appears, click on the "New Rule" button to enter the first condition.
When the New Formatting Rule window appears, select Format only cells that contain as the rule type.
Then select Cell Value in the first drop down, less than in the second drop down, and enter the following formula: =NOW()+30 Next, we need to select what formatting to apply when this condition is met. To do this, click on the Format button.
When the Format Cells window appears, select the Fill tab. Then select the color that you'd like to see the dates that will expire in the next 30 days. In this example, we've selected green. Then click on the OK button.
When you return to the New Formatting Rule window, you should see the preview of the formatting in the Preview box. In this example, the preview box shows green as the fill color. Next click on the OK button
This will return you to the Conditional Formatting Rules Manager window. Select Ok.
The stock that has already expired and the stock that will expire in less than 30 days from now will be highlighted in green.
Tip 24
Data Validation
Question: I have a list of all the companys employees in an Excel report and would like t o assign the specific department they work in. Is there a way to do this without having to type the department next to each employees name? Answer: Yes, by using Data Validation in Excel Why: You use data validation to control the type of data or the values that users enter into a cell. For example, you may want to restrict data entry to a certain range of dates, limit choices by using a list Applies To MS Excel 2003, 2007, 2010 1. 2. First create a list in an Excel Worksheet for the Department Names Select sheet 1 worksheet tab and enter as below
3. 4.
Select A3:A10 and enter Dept in the name box (You must press the enter key after typing Dept) Select sheet 2 worksheet tab, and select the cells in the Department Column of the report (E5:E17)
5.
Add the Data Validation to the selected cells. Refer to the screen shot below
5.
The following screen will be displayed, select the criteria as shown below. To insert the range name (Dept.) you can either type in =Dept or press F3 in the Source text box and then select Dept from the list of Named Ranges
6.
Select OK and enter employees information. To choose the department, select the drop down arrow in column E. A list of departments will be displayed thus automating the entry of departments into the worksheet. The screen shot is displayed below
Tip 25
Format
Extension
Description The default XML-based file format for Excel 2010 and Excel 2007. Cannot store Microsoft Visual Basic for Applications (VBA) macro code or Microsoft Office Excel 4.0 macro sheets (.xlm). The XML-based and macro-enabled file format for Excel 2010 and Excel 2007. Stores VBA macro code or Excel 4.0 macro sheets (.xlm).
.xlsx
.xlsm
.xlsb
The binary file format (BIFF12) for Excel 2010 and Excel 2007.
Template
.xltx
The default file format for an Excel template for Excel 2010 and Excel 2007. Cannot store VBA macro code or Excel 4.0 macro sheets (.xlm). The macro-enabled file format for an Excel template Excel 2010 and Excel 2007. Stores VBA macro code or Excel 4.0 macro sheets (.xlm).
Template (code) Excel 97Excel 2003 Workbook Excel 97Excel 2003 Template
.xltm
.xls
.xlt
The Excel 97 - Excel 2003 Binary file format (BIFF8) for an Excel template.
Extension
Description
.xls
.xml
XML Data
.xml
XML Data format. The XML-based and macro-enabled Add-In format for Excel 2010 and Excel 2007. An Add-In is a supplemental program that is designed to run additional code. Supports the use of VBA projects and Excel 4.0 macro sheets (.xlm). The Excel 97-2003 Add-In, a supplemental program that is designed to run additional code. Supports the use of VBA projects. An Excel 4.0 file format that saves only worksheets, chart sheets, and macro sheets. You can open a workbook in this file format in Excel 2010, but you cannot save an Excel file to this file format.
Excel Add-In
.xlam
.xla
.xlw
Tip 26
Rank Function
Question: How do I return the rank of a number in a list of numbers relative to other values in a list?
Answer: By using the RANK function in Excel. The function returns the rank of a number in a list of numbers. The rank of a number is its size relative to other values in a list. (If you were to sort the list, the rank of the number would be its position.) Why: To rank numbers in a given list so that one can easily determine the top performing product
Applies To: Excel (2010, 2007, and 2003): 1. Refer to the data given below
2.
Select cell F3 and type; =Rank(E3,$E$3:$E$11) RANK(number,ref,[order]) The RANK function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.): Number (Required.) The number whose rank you want to find. Ref (Required.) An array of, or a reference to, a list of numbers. Non-numeric values in ref are ignored. Order (Optional.) A number specifying how to rank number. If order is 0 (zero) or omitted, Microsoft Excel ranks number as if ref were a list sorted in descending order.
If order is any non-zero value, Microsoft Excel ranks number as if ref were a list sorted in ascending order 3. 4. Press Enter and copy the formula down The result will be the screen shot below
The products sales have now being ranked in order of Product Sales Amount, and one can easily determine the best performing product by looking at the rank column and checking the corresponding product name.
Tip 27
PV function
Question: How much deposit do I need to pay in order to have a monthly installment of $400 over a period of 4 years for a car costing $15,000? The interest rate is 8.5% Answer: The PV function will be used to find a solution. The PV Function returns the present value of an investment. The present value is the total amount that a series of future payments is worth now. For example, when you borrow money, the loan amount is the present value to the lender Why: To calculate the amount of deposit to be paid for a car costing $15,000
Applies To: Excel 2010, 2007, and 2003 1. Select Formulas- Insert function > Financial and select as below
3. Select OK The amount of deposit to be paid for a car costing $15 ,000 at a monthly installment of $400 over 4 years and interest rate of 8.5% is $ 5 538.94 . You can also type the formula in excel as; =PV(8.5%/12,48,- 400,15000)
PV(rate, nper, pmt, [fv], [type]) The PV function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure) Rate Required. The interest rate per period. For example, if you obtain an automobile loan at a 10 percent annual interest rate and make monthly payments, your interest rate per month is 10%/12, or 0.83%. You would enter 10%/12, or 0.83%, or 0.0083, into the formula as the rate Nper Required. The total number of payment periods in an annuity. For example, if you get a four-year car loan and make monthly payments, your loan has 4*12 (or 48) periods. You would enter 48 into the formula for nper Pmt Required. The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. For example, the monthly payments on a $10,000, four-year car loan at 12 percent are $263.33. You would enter -263.33 into the formula as the pmt. If pmt is omitted, you must include the fv argument Fv Optional. The future value or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). For example, if you want to save $50,000 to pay for a special project in 18 years, then $50,000 is the future value. You could then make a conservative guess at an interest rate and determine how much you must save each month. If fv is omitted, you must include the pmt argument Type Optional. The number 0 or 1 and indicates when payments are due
Tip 28
Applies To: Excel 2010, 2007, 2003: 1. Refer to the data given below
2. 3.
4.
5.
6.
7. 8.
Two charts (line and column will be displayed) Right select the line graph and select as below
9.
10.
Two graphs with separate axis have been combined in one chart. Therefore one can easily interpret the different sets of data in the chart.
Tip 29
Workdays
Question: How can I calculate the number of workdays between two dates? The usual off days are Saturday, Sunday and public holidays. Answer: Why: By using the Networkdays function To calculate the number of workdays between two dates
Applies To: Excel (2010, 2007): 1. The data below will be used for illustration purposes
2. 3.
Select cell A7 Select Formulas>Date & Time>NETWORKDAYS. Refer to the screen shot below
4.
The number of workdays between the two given dates is 78. The formula can also be entered in this way; =NETWORKDAYS (A3,A4,A5:A6). The formula subtracts the usual weekend days and any specified holidays from the difference between the start and end dates of the project.
Tip 30
Trends
Question: Is there a function in MS Excel that can be used to predict future sales based on past performance or sales trends? Answer: Yes, by using the Trend function
Description: Returns values along a linear trend. Fits a straight line (using the method of least squares) to the arrays known_y's and known_x's. Returns the y-values along that line for the array of new_x's that you specify Syntax: TREND(known_y's, [known_x's], [new_x's], [const]) Why: To predict future sales based on past performance or trends
Applies To: Excel 2003, 2007, 2010 1. The data below will be used for illustration purposes
2. 3. 4.
To predict the sales for periods 10, 11 and12 Select cell B11 and enter; =Trend(B2:B10,A2:A10,A11:A13) The projected sales for periods 10, 11 and 12 will be as below;
The projected sales for periods 10, 11 and 12 can thus be estimated based on past trend or performance
Tip 31
Aggregate Function
Question: How do I calculate the sum for a range of numbers with error values within the range? Using the standard sum function in Microsoft Excel returns an error. Answer: Why: By using the Aggregate function in MS Excel 2010. To find the sum for a range of numbers where there are error values within the range.
Description: The AGGREGATE function addresses the limitation of conditional formatting. Data bars, Icon Sets and Color Scales cannot display conditional formatting if there are errors in the range. This is because the MIN, MAX and PERCENTILE functions do not calculate when there is an error in the calculation range. The LARGE, SMALL, and STDEVP functions also affect the appropriate functionality of certain conditional formatting rules for the same reasons. By using the AGGREGATE function, you can implement those functions because the errors will be ignored. In addition, the AGGREGATE function can apply different aggregate functions to a list or database with the option to ignore hidden rows and error values Syntax: AGGREGATE(function_num, options, ref1, [ref2], )
2. 3. 4. 5. 6. 7. 8.
Select B11 and enter; =sum(B5:B10) and press enter An error message will be displayed in the Total. Delete the error message in cell B11 To overcome this limitation, we shall use the Aggregate function Select cell B11 Select Formulas, Insert Function and search for the Aggregate function Select OK Select as below
9.
Enter as below
10. 11.
The following numbers represent some function numbers than can be used in the formula above: 1=Average,2=Count,3=CountA,4=Max,5=Min,9=Sum. For Option numbers refer to the table below. OPTION 0 or omitted BEHAVIOUR Ignore nested SUBTOTAL and AGGREGATE functions
1 2 3 4 5 6 7
Ignore hidden rows, nested SUBTOTAL and AGGREGATE functions Ignore error values, nested SUBTOTAL and AGGREGATE functions Ignore hidden rows, error values, nested SUBTOTAL and AGGREGATE functions Ignore nothing Ignore hidden rows Ignore error values Ignore hidden rows and error values
Tip 32
Subtotal Command
Question: Answer: Why: Applies To: I have a list of sales transactions for various months. How can I quickly calculate the total sales for each month? By using the Subtotal command To calculate the total sales for each month Excel 2003, 2007 and 2010
2. The data must be sorted. Select any cell within the date column (column B) 3. Select as below, to sort in ascending order
7. The subtotals for each month will be computed as above. To display the Grand total value select 1 8. For the monthly totals only select 2. To display the entire data list with subtotals for each month select 3
Tip 33
3. Select on the arrow alongside the table you wish to query. See below
4. Select the location, (the cell you would like to insert the data in), of the data and select OK 5. The data will be displayed as below
The table/data can then be updated or refreshed by selecting Data, Refresh All. In this way the latest data will be displayed in MS Excel spreadsheet. MS Excel functionality can also be used to analyze or format the data.
Tip 34
Applies To:
2.
When a subtotal command is applied to the sorted data the result will be as below
4. To select only the visible cells as given above; a. On the Home tab, in the Editing group, click Find & Select, and then click Go To Special
b. Under Select, click Visible cells only, and then click OK c. On the Home tab, in the Clipboard group, click Copy
Keyboard shortcut: CTRL+C d. Select the upper-left cell of the paste area. e. On the Home tab, in the Clipboard group, click Paste Keyboard shortcut: CTRL+V
Tip 35
2. To predict the project end date, select B8 an, enter as below 3. =Date(2011+B4,5+B5,5+B6) 4. The project will end on the 18-10-2012, as given below
Tip 36
1. Press and release the ALT key The KeyTips are displayed over each feature that is available in the current view
2. To apply conditional formatting using access keys; Refer to the data below
3. Select C2:C18
4. Press the ALT key 5. Press H 6. Press L 7. Press H 8. Press G 9. Enter as below
10. Press the Enter Key 11. The result will be as below
Tip 37
2. Select the range; C2:C8 3. From the Data tab, in the Data Tools group, select Data Validation 4. Select as below;
5.
6.
Enter 01/01/2011 in cell C2.An error message given below will be displayed since 01/01/2011 is less than 14/01/2011
Thus one is able to ensure that the data that users enter into a worksheet conforms to certain standards by enforcing the data validation rule
Tip 38
GETPIVOTDATA
Question: Is there a way to quickly extract certain data from a PivotTable in Microsoft Excel? Answer: Yes, but using the GETPIVOTDATA function Description: Returns data stored in a PivotTable report. You can use GETPIVOTDATA to retrieve summary data from a PivotTable report, provided the summary data is visible in the report Applies To MS Excel 2007, 2010 1. The PivotTable report below includes detailed information on the sales by customer and product; to easily extract the Grand Total for Sales you can use the GETPIVOTDATA function
2. Select in a blank cell and enter the following GETPIVOTDATA function 3. =GETPIVOTDATA("TotalSale",$E$10) 4. This will give you the Grand Total Figure for Total Sale $1,029,790.03
SYNTAX
GETPIVOTDATA(data_field, pivot_table, [field1, item1, field2, item2], ...) The GETPIVOTDATA function syntax has the following arguments: Data_field Required. The name, enclosed in quotation marks, for the data field that contains the data that you want to retrieve Pivot_table Required. A reference to any cell, range of cells, or named range of cells in a PivotTable report. This information is used to determine which PivotTable report contains the data that you want to retrieve Field1, Item1, Field2, Item2 Optional. 1 to 126 pairs of field names and item names that describe the data that you want to retrieve. The pairs can be in any order. Field names and names for items other than dates and numbers are enclosed in quotation marks
Tip 39
4. Enter the following criteria for the Data Validation Input Message Window
5. Enter the following criteria for the Data Validation Error Alert Window 6.
ID-23456789
ID456878673
You will get an Error alerting you that the Incorrect Product ID has been entered Note: The input message prompts you to enter the correct Product IDs
Tip 40
IF Function
Question: I have number of sales employees in my organization and I would like to automatically calculate, if they reach a certain target, their commission based on their above target figures. If they reach a specific above target I want to multiply this target by a set percentage, if they dont reach the target, I need this target figure to be multiplied by different percentage. Answer: Use the IF Function. The IF function is one of Excels most useful and most used functions. What it does, basically, is test to see whether a certain condition is true or false. If the condition is true, the function will do one thing, if the condition is false, the function will do something else. Syntax: =IF(logic test, value if true, value if false) How: 1. To calculate the commission figures for the following employees. Base on the following criteria. If the above target figure is above the target benchmark of $10,000 then multiply the value by 20% if the above target figure is below $10,000 then multiply the figure by 5%
2. You can use the IF Statement 3. Use the following formula and copy down =IF(B5>10000,B5*20%,B5*5%) 4. The commission figures will be automatically calculated based on the IF function
5. The logic test is always a comparison between two values. Comparison operators are used, for example, to see if the first value is greater than or less than the second, or equal to it 6. While the logic test section is limited to answering a true or false question, you have greater flexibility in what you place in the last two arguments 7. The IF function can perform different calculations depending on whether the function returns a true value or not Note: There is no comma separator used for the number in 10,000 in the above example. This is because the IF function uses the comma to separate the three sections of the IF function contained within the round brackets.
Tip 41
Hlookup
Question: How can I search for a value in the top row of the table and then return a value in the same column from a specified row? By using Hlookup To perform a horizontal lookup on a data list Applies To: Excel 2003, 2007, 2010 1. Refer to the data given below;
Answer: Why:
2. To find the total sales for the South Coast; 3. Select any empty cell 4. Select as below
3.
The formula can also be entered as =HLOOKUP(C2,B2:E6,4,False) The syntax of the Hlookup formula is as given below. = HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
Lookup_value . The value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string. Table_array . A table of information in which data is looked up. Use a reference to a range or a range name. Row_index_num . The row number in table_array from which the matching value will be returned. Range_lookup . A logical value that specifies whether you want HLOOKUP to find an exact match or an
approximate match. If TRUE or omitted, an approximate match is returned.. If FALSE, HLOOKUP will find an exact match.
Tip 42
Answer: Yes, by using the Slicers connection functionality. If you have created 2 PivotTables and you have created a slicer off the PivoTable1, you can connect the same slicer to use Filter on the PivotTable2 Applies: Method: 1. Select a cell in the second PivotTable 2. On the Excel Ribbons Options tab, click Insert Slicer 3. Click Slicer Connections Excel 2010
4. In the Slicer Connections window, add a check mark the slicer to Connect to PivotTable2.
Both pivot tables are now connected to the Slicer. If you select an item in a slicer, both pivot tables will be filtered. For example, in the Warehouse slicer below, Central is selected, and both pivot tables show only the Central Warehouse related data.
Before Filter:
Tip 43
2. 3.
4.
5.
6. A list of names will confirm that the column headings have been automatically generated as the names for the corresponding data
Tip 44
Applies To: MS Excel 2003, 2007, 2010 1. Refer to the data given below. The Operations Budget figures for the North, South, East and West are captured on the respective worksheets as given below. The consolidated budget figure will be displayed on the summary worksheet
The budget figures captured on the South, East & West worksheets in the order of the months given above is; South: $51 000, $32 000, $45 000, $74 000, $90 000, $88 000 East: $120,000, $95 000, $88 000, $93 000, $54 000, $34 000
West: $45 000, $34 000, $87 000, $89 000, $56 000, $77 000 2. 3. Select C4:C9 on the North worksheet Select as below
4.
5. 6. 7. 8.
Select OK and then select the close button Select cell G9 on the summary worksheet and enter the following formula; =Sum(RegionTotals) Press the Enter Key The consolidated Regional Total Value of $1,598,000.00 will be displayed
Tip 45
Large Function
Question: You know how to find the largest value from a given data range by using the maximum function. But how can one find the second largest value from a data range? Answer: Why: By using the LARGE function Returns the k-th largest value in a data set. You can use this function to select a value based on its relative standing. For example, you can use LARGE to return the highest, runner-up, or third-place score Syntax: =Large(Array,K) Array is an array or range of numerical data for which you want to determine the k-th largest value K is the position (from the largest) in the array or range of data to return Applies To: Excel 2003, 2007 and 2010
1. To find the second largest value from the following data range;
2. Select cell B19 and type =Large(B2:B17,2) 3. The answer will be $2128.00 meaning the second best sales person is Johnson A The LARGE function can also be used as an alternative to the MAX function.
Tip 46
TRIM Function
Question: I have just imported data into MS Excel. How do I remove leading or trailing spaces from the data? I also would like to limit the amount of space between words to one Answer: Why: By using the TRIM function Removes all spaces from text except for single spaces between words. Use TRIM on text that you have received from another application that may have irregular spacing
Applies To: MS Excel 2003, 2007, 2010 1. For this example the screen shot given below will be used
2. 3.
Select cell B2 and type =Trim(A2) then press enter. Drag the formula down The result will be as follows
As you can see from the data above, all spaces from the text except for single spaces between words have been removed.
Tip 47
Small Function
Question: Answer: Why: Is there an alternative to the minimum function when finding the smallest value in a given data range? Yes, the Small function Returns the k-th smallest value in a data set. Use this function to return values with a particular relative standing in a data set Syntax SMALL(array,k) Array value. K Applies To: is the position (from the smallest) in the array or range of data to return is an array or range of numerical data for which you want to determine the k-th smallest
2. Select cell B19 and type =Small(B2:B17,1) 3. The answer will be $29.20 meaning the sales person with the lowest sales value is Anderson .P.
Tip 48
Mode Function
Question: Answer: Why: We commissioned a research into the buying habits of our clients. How can we find the most frequently ordered quantity of our product? By using the Mode function Returns the most frequently occurring, or repetitive, value in an array or range of data. Syntax MODE(number1,number2,...) Number1, number2, ... are 1 to 255 arguments for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas. Remarks Arguments can either be numbers or names, arrays, or references that contain numbers. If an array or reference argument contains text, logical values, or empty cells, those values are ignored. Applies To: Excel 2003, 2007 and 2010
2. To find the mode ; 3. Select B12 and type =Mode(B3:B11) 4. The answer will be 10 5. Meaning the quantity of product A that most clients ordered is 10
Tip 49
Transpose Option
Question: Answer: Why: Can I return a horizontal range of cells as a vertical range, or vice versa? Yes, using the transpose option To change the positional alignment of the data
Applies To: MS Excel 2003, 2007, 2010 1. For this example we shall make use of the screen shot given below
2. 3. 4. 5.
6.
7. 8.
Select cells A1:O1 then press the delete key The result will be as follows
Initially the data in row 1 was aligned horizontally but has been changed to vertical alignment and placed in column D by using the transpose option
Tip 50
REPT Function
Question: How do I display the total sales amount by way of a chart? I dont want to use the normal chart options given in excel. Is there an alternative to the normal chart options? Answer: Why: Yes, the REPT function Repeats text a given number of times. Use REPT to fill a cell with a number of instances of a text string Syntax REPT(text,number_times) Text Required. The text you want to repeat Number_times Required. A positive number specifying the number of times to repeat text
Applies To: MS Excel 2003, 2007, 2010 1. The screen shot below will be used to illustrate this example
2. 3.
Select cell D4 and type =REPT(I,C4) & C4 The result will be as follows