19
Excel Tips for Compensation Practitioners Weeks 74 - 76 Mathematical and Statistical Formulae Week 74 Using Rounding Formulae There is often confusion in Excel around formatting data to no decimal places and rounding data. When Excel formats data to no or a number of decimal places, the data appears to be rounded, but it is not - Excel still retains the original data with all its decimals. If the data must be actually rounded, for calculation purposes, you need to use one of the many rounding options available to you under the Mathematical and Trig formulae, or you can use the ASAP-Utilities rounding function. In this column we will look at how to use the following rounding formulae, ROUND, ROUNDUP, ROUNDDOWN, INT, MROUND (a little known but very useful rounding option) and rounding using ASAP-Utilities. Let’s work with the following set of data: travel claims, commission, age and salary for a group of Sales Representatives for a specific month. Please remember that the figures are illustrative only and not intended to replicate market data in any country. Let’s say that you want to do the following: a) round the travel claims to two decimal places for payment purposes b) round the commission up to the nearest 10 (dollars or other currency), for payment purposes c) round age down to the nearest year (age is always rounded down we never want to be thought older than we are!). Generally length of service and time in job are also rounded down. d) increase the monthly salary by 5% and then round to the nearest 50 (dollars or other currency).

Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Embed Size (px)

Citation preview

Page 1: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae

Week 74 Using Rounding Formulae

There is often confusion in Excel around formatting data to no decimal places and rounding data. When Excel formats data to no or a number of decimal places, the data appears to be rounded, but it is not - Excel still retains the original data with all its decimals. If the data must be actually rounded, for calculation purposes, you need to use one of the many rounding options available to you under the Mathematical and Trig formulae, or you can use the ASAP-Utilities rounding function. In this column we will look at how to use the following rounding formulae, ROUND, ROUNDUP, ROUNDDOWN, INT, MROUND (a little known but very useful rounding option) and rounding using ASAP-Utilities. Let’s work with the following set of data: travel claims, commission, age and salary for a group of Sales Representatives for a specific month. Please remember that the figures are illustrative only and not intended to replicate market data in any country.

Let’s say that you want to do the following:

a) round the travel claims to two decimal places for payment purposes b) round the commission up to the nearest 10 (dollars or other currency), for payment

purposes c) round age down to the nearest year (age is always rounded down – we never want to be

thought older than we are!). Generally length of service and time in job are also rounded down.

d) increase the monthly salary by 5% and then round to the nearest 50 (dollars or other currency).

Page 2: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Starting with rounding the travel claims to two decimal places, you can do this using a straightforward rounding formula, ROUND. As with all formulae, this needs to be applied one cell at a time and copied down the table. To apply the formula, click on cell D2. click the fx icon, select Math & Trig for Category, then ROUND for function. Or alternatively, in Excel 2007, click on the Formulas Tab, select Math & Trig, click on the down arrow beneath Math & Trig and select ROUND – see below. Note that beneath ROUND, you will see the other options we will be using later, ROUNDDOWN and ROUNDUP.

For number, see screen shot below, select C2, the first travel claim. Next to Num-digits, put the following: 0 if you want to round to no decimal places 1 if you want to round to 1 decimal place, 2 if you want to round to 2 decimal places etc. -1 if you want to round to the nearest 10 -2 if you want to round to the nearest 100 -3 if you want to round to the nearest 1000, etc.

Page 3: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

In our case we want to round to two decimal places, so type in 2. Click OK and copy the formula down the table. Your travel claims data will now look like this.

Next we want to round the commission up to the nearest 10 (dollars or other currency). Remember that the ROUND function will round down if the amount is below half (0.5, 5, 50 or whichever multiple of 5 is appropriate) or round up if the amount is >= half (0.5, 5, 50 or whichever multiple of 5 is appropriate). The ROUNDUP function rounds the amount upwards, no matter whether the amount is below or above half.

Page 4: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

To apply the ROUNDUP formula, click on cell F2, click the fx icon, select Math & Trig for Category, then ROUNDUP for function. Or alternatively, in Excel 2007, click on the Formulas Tab, select Math & Trig, click on the down arrow beneath Math & Trig and select ROUNDUP.

Next to Number, see screen shot above, click E2, the first commission amount. Next to Num_digits, put -1 as we want to round to the nearest 10. Click OK and copy the formula down the table. Your commission data will now look like this.

Page 5: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Next we want to round age down to the nearest whole number. This can be done in two ways, using ROUNDDOWN or INT. To apply the ROUNDDOWN formula, click on cell H2, click the fx icon, select Math & Trig for Category, then ROUNDDOWN for function. Or alternatively, in Excel 2007, click on the Formulas Tab, select Math & Trig, click on the down arrow beneath Math & Trig and select ROUNDDOWN.

Next to Number, see screen shot above, click G2, the first age. Next to Num_digits, put 0 as we want to round age down to the nearest whole number. Click OK and copy the formula down the table. As an alternative, where you want to round down to the nearest whole number, you can use the INT formula. This effectively takes the integer or whole number portion of the number. To use this formula, click on cell H2, click the fx icon, select Math & Trig for Category, then INT for function. Or alternatively, in Excel 2007, click on the Formulas Tab, select Math & Trig, click on the down arrow beneath Math & Trig and select INT.

Page 6: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Next to Number, see screen shot above, click G2, the first age. Click OK and copy the formula down the table. Using either of these formulae, your age data will now look like this. If you had used the INT formula, your formula would appear as follows: =INT(G2).

The last rounding step we want to do is to increase the monthly salary by 5% and then round the result to the nearest 50 (dollars or other currency). To do this, Excel has a very useful formula called MROUND, which enables you to round to an amount that is not to the base of 10. For example you might want to round to the nearest 50, 500, 5000, 25, 250, 2500, 20, 200 or 2000. To apply this function, in this case first increase the first salary by 5% using the following formula in cell J2, =I2*1.05. Next, in cell K2, click the fx icon, select Math & Trig for Category, then MROUND for function. Or alternatively, in Excel 2007, click on the Formulas Tab, select Math & Trig, click on the down arrow beneath Math & Trig and select MROUND.

Page 7: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Next to Number, see screen shot above, click J2, where the increased salary is. Next to Multiple, type 50 as we want to round the increased salary to the nearest 50. Click OK and copy the formula down the table. Note that you can enter any integer (whole number) as a multiple. Excel will calculate multiples of this number, starting from zero, and will round up or down to the nearest multiple of the number. Your increased salary data will now look like this.

All of the rounding formulae are at this stage still linked to the original data. If you want to delete the original data, you need to convert the rounded data from a formula to the result of the formula. To do this, you can select the whole worksheet by clicking in the top left hand corner above A1, or select the whole table by clicking in cell A1, and pressing control A. Click Copy, then in Excel 2003 click on the down arrow next to Paste and select Values. In Excel 2007 click on the down

Page 8: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

arrow under Paste and select Paste Values. All the formulae will be converted to values, and you can now delete the original unrounded data. Another quicker and simpler way to round data is to use the add in ASAP Utiltiies function, which can be downloaded from the ASAP-Utilities.com site. To illustrate rounding the travel claims, first select all the data that you want to round. Then click on the ASAP Utilities menu, select Numbers, then option number 10, Round numbers – see below. The menu will look a little different in Excel 2003, but the options and option numbers are the same.

In the window, see below, type 2 for two decimal places or as desired. Click OK.

Your data will now be rounded in its place, i.e. the original data will be replaced with the rounded data. This is obviously much quicker than writing the formula, copying it down the table and then converting it to a value. However, if you wish to use any of the specialist round functions, ROUNDUP, ROUNDDOWN or MROUND, you need to use the fx formula method. Next week we will look at how to create a histogram / distribution table and graph using the FREQUENCY formula.

Page 9: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Week 75 Creating a Distribution Table using the Frequency Formula

In Week 22 we looked at how to create a distribution table and graph using the add in histogram function. The histogram function is a convenient and quick way to do this, but the drawback is that it produces output which is not connected to the original data. In this column we will look at how to create a distribution table and graph that are connected to the original data, so if this data changes, the table and graph will change. This is particularly useful for Excel dashboards, which are executive summary sheets, often interactive, showing summary statistics, trends etc. I have used the frequency formula, for example, in an Excel dashboard, together with a linked histogram graph, allowing managers to model where they should set incentive targets in order to achieve a desired payout distribution. This provides a very effective and immediate visual picture of the distribution pattern to the manager. Let’s work with the same data as in Week 22 – see below. The data represents the base salaries for a group of employees in the same grade in a department, and we want to look at the distribution pattern of salaries in this grade..

You first need to decide how best to group the data, so that you can examine the distribution. This process was outlined in Week 22, and resulted in intervals of 500, starting with 4000, just above the first data point and ending with 7500, so that all the data points were covered. This results in 8 intervals, which is an ideal number, as it is generally best to group data into between 5 and 10 intervals. You then need to calculate how many data points are between each of these intervals. If you are going to do this using a formula, you need to do the calculation in two stages, first calculating the cumulative frequency, i.e. how many data points in total are below the interval number, and then the actual frequency, i.e. how many data points are between one interval and another.

Page 10: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Starting with the cumulative frequency, in cell G2, click the fx icon, select Statistical for Category, then FREQUENCY for function. Or alternatively, in Excel 2007, click on the Formulas Tab, select More Functions, Statistical, click on the down arrow beneath Statistical and select FREQUENCY. In the function argument box, see below, next to Data_array, select the data points from C2 to C21, press the F4 key to make these absolute, then next to Bins_array, select the first interval in cell E2. Click OK.

You will now see the number 3 in cell G2, indicating that 3 employees are paid below the first interval of 4000. Copy this formula down the table, and it will calculate the cumulative frequency for each interval, i.e. how many employees in total are paid below that interval amount – see screen shot below. The final cumulative frequency number, in this case 20, must equal the total number of data points in the data set.

Page 11: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Next you need to calculate the actual frequency, i.e. how many employees are paid between each of the intervals. To do this, first in cell H2, type =G2, to make it equal to the cumulative frequency in cell G2. Next, below this in cell H3, type =G3-G2. This will subtract the cumulative frequency in cell G2 from the cumulative frequency in cell G3, and will tell you how many employees are between the first and second intervals. Copy the formula in cell H3 down the table, and your data should look like this, showing the frequency or distribution of salaries in each of the intervals. The sum of all the frequencies, in this case 20, must equal the total number of data points in the data set and the final cumulative frequency number.

Page 12: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Next you can graph this data as a histogram (column chart) or a smoothed curve distribution graph. When you graph the data, you first need to graph the data values, and then later add the X axis values, as if you try to create the graph in one go, Excel will assume that both columns are data values. To graph the data in Excel 2007, select the data values in cells H1 to H9, including the heading, click insert, click on the Column graph, and choose the first 2D column, delete the legend. Your graph will look like this.

Point at the graph, right click, choose Select Data, then in the Select Data Source window – see below, under the Horizontal (Category) Axis Labels, click on Edit and choose the interval values in cells E2 to E9. Click OK, OK.

Page 13: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Your graph will now look like this, with the interval values shown on the X axis.

To graph the data in Excel 2003, select the data values in cells H1 to H9, including the heading, and use the chart wizard to create a 2D column chart. Delete the legend, and your graph will look like this.

Page 14: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Point at the graph, right click, choose Source Data, click on the Series tab, then next to Category (X) axis labels, see below, choose the interval values in cells E2 to E9. Click OK.

Page 15: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Your graph will now look like this, with the interval values shown on the X axis.

You can convert this column graph to a line graph by right clicking on the columns, selecting Change Series Chart Type (Excel 2007) or Chart Type (Excel 2003), selecting the first line chart without markers and clicking OK. This will convert the columns to a line. Next click once on the line, right click and select Format Data Series. In Excel 2007, choose Line Style on the left and check the box for Smoothed Line. In Excel 2003, under the Patterns tab, check the box for Smoothed Line. Your graph will now look like this, with slightly different formatting in Excel 2003. Both the histogram and the column chart indicate that the data is positively skewed, with a distinct tail to the right hand side.

If any of the raw data changes, the table and graph will also change. In Excel dashboards, as discussed in the introduction, this is very effective, as the user selects an input cell to change a key value, and in response the distribution graph changes, giving an immediate visual feel of the impact of the change. Next week we will look at how to calculate z scores, and 2 and 3 sigma boundaries on basic salary for a group of employees.

Page 16: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

Week 76 How to calculate z-scores, and 2 and 3 sigma boundaries

In Week14 we looked at how to calculate measures of central tendency, including the mean / arithmetic average, and in Week 16 at how to calculate measures of variance, including the standard deviation. These two statistics, the mean and the standard deviation, can be used together to provide a third statistic, the z-score, and to calculate 2 and 3 sigma boundaries. Starting with the z-score, this is an indication of how many standard deviations a data point is away from the mean, and is a very good measure of pay discrimination. It provides similar information to that obtained using the 2 and 3 sigma boundaries, which will be discussed later in the column. Use of z-scores and 2 and 3 sigma boundaries is covered in detail in T3 and GR2 – the Worldatwork Quantitative Methods courses. To illustrate calculation of a z-score, let’s work with a similar set of data to that used in Weeks 14 and 16 – see below. This data represents basic cash salaries for a group of employees in the same position in the same grade. Remember that this data is purely illustrative and not intended to replicate market data in any country.

For this set of data you wish to determine if any of the employees in the position are significantly over or under paid relative to the average. To do this in a scientific fashion, you need to calculate the z-score for each employee. The z-score, as mentioned in the introduction, is based on two statistics, the mean and the standard deviation, so these first need to be calculated. To do this, you can either type in the formulae or click fx icon, Statistical, and use the AVERAGE and STDEVP formulae if the data is a population, or STDEV if the data is a sample – see Weeks 14 and 16 for these formulae.

Page 17: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

The formula in cell E20 should read =AVERAGE(E2:E19). Given that this data is a population, the formula in cell E21 should read =STDEVP(E2:E19). The z-score is equal to (data point – mean) / standard deviation. To obtain the z-score for the first basic cash salary, in cell F2 write the formula, =(E2-$E$20)/$E$21. You need to make E20, where the mean is stored, and E21, where the standard deviation is stored, absolute by pressing the F4 key, so that, as you copy the formula down the table, the formula will always reference these cells. Copy the formula down the table, and your data will look like this. Note that, when you apply the z-score formula to the average / mean, see the formula in row 20, the z-score will always equal zero, as the mean is 0 standard deviations away from the mean. Another test as to whether you have calculated your z-scores correctly is that the average of all the z-scores must always equal zero.

Generally any z-score higher than +2 or lower than -2 is regarded as significantly different from the mean. In this set of data the first employee, with a basic cash salary of 1350, has a z score of -2.055, which means that she is being paid 2.055 standard deviations less than the average, and is regarded as a significant outlier. The last employee, with a basic cash salary of 10570, has a z score of +2.349, which means that he is being paid 2.349 standard deviations more than the average, and is also regarded as a significant outlier. The other employees have z-scores of between -2 and +2, and are therefore not regarded as outliers. Another way to establish whether employees are outliers or not is to calculate the upper and lower 2 and 3 sigma boundaries. (Sigma is the Greek symbol used for the standard deviation.) The upper 2 sigma boundary is the mean plus 2 standard deviations. The lower 2 sigma

Page 18: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week

boundary is the mean minus 2 standard deviations. The upper 3 sigma boundary is the mean plus 3 standard deviations. The lower 3 sigma boundary is the mean minus 3 standard deviations. If an employee is paid outside of these boundaries, then he/she would be regarded as an outlier. To calculate the upper 2 sigma boundary, in cell G20, type =E20+2*E21. The result is 9840. To calculate the lower 2 sigma boundary, in cell G21, type =E20-2*E21. The result is 1464. To calculate the upper 3 sigma boundary, in cell H20, type =E20+3*E21. The result is 11934. To calculate the lower 3 sigma boundary, in cell H21, type =E20-3*E21. The result is -629. To determine whether each employee’s salary is inside or outside of the 2 sigma boundary, in cell G2 type the formula =IF(OR($E2<G$21,$E2>G$20),"yes","no"). This formula says: if the salary in cell E2 is either below the lower 2 sigma boundary in cell G21, or above the upper 2 sigma boundary in cell G20, put a yes in the cell, else put a no. Copy this formula down the table and across to the right to test for the salary being outside of the 2 and 3 sigma boundaries, and your data should look like this.

It can be seen that the employee with a z-score of -2.055 is outside of the 2 sigma boundary, but not outside of the 3 sigma boundary. The same applies to the employee with a z-score of 2.349. Calculating the z-score and the 2 and 3 sigma boundaries therefore provides similar information about whether employees are outliers or not in terms of their salary, and whether there is concern about possible gender or other discrimination.

Page 19: Excel Tips for Compensation Practitioners storage/Documents/excel tips...Excel Tips for Compensation Practitioners – Weeks 74 - 76 – Mathematical and Statistical Formulae Week