Unit-3 Gathering and Processing Data For Reports
Unit-3 Gathering and Processing Data For Reports
Objectives
In this chapter, you will learn to:
Organize data
Process data
Organizing Data
Consider the scenario of Alpha Supermart. Recently, the company has expanded its business and
opened new stores at various locations in Philadelphia. Simon, the Finance Executive, is responsible for
maintaining all the records in the ledger books. It has become a tedious task for him to maintain such
voluminous data manually, as they are cluttered. In order to maintain the data effectively and
efficiently, he needs to organize the data in the required order and format.
Sort
Filter
Group
Sorting can be done on multiple columns by using the Custom Sort feature. You can apply this
feature by using the Sort dialog box, as shown in the following figure.
You can also use the preceding dialog box to refine the sort with additional filters, such as cell
color or values, by using the Sort On drop-down list. In addition, you can specify the order in
which you can arrange the data. For example, a worksheet contains the details of the members of
a fitness club, such as Member ID, First Name, Last Name, Gender, Address, Contact Number,
and Plan ID. You can sort the data in the worksheet on Plan ID of the members in the ascending
order. In addition, you can apply another level of sorting on the basis of First Name of the
members. Data in a worksheet can also be sorted by using the custom list feature. Microsoft
Excel has the following default custom lists:
Abbreviated days: It includes Sun, Mon, Tue, Wed, Thu, Fri, and Sat.
Days: It includes Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday.
Abbreviated months: It includes Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and
Dec.
Months: It includes January, February, March, April, May, June, July, August, September,
October, November, and December. In addition, you can create your own custom list, on the
basis of which, data can be sorted.
3. Click the Sort & Filter drop-down button in the Editing group under the Home tab. The
4. Select the Sort A to Z option. The data in the SupplierDetails.xlsx workbook will be
3. Click the Sort & Filter drop-down button in the Editing group under the Home tab. The
drop-down list is displayed.
4. Select the Custom Sort option. The Sort dialog box is displayed, as shown in the following
figure.
6. Ensure that the Values option is selected in the Sort On drop-down list.
7. Ensure that the Smallest to Largest option is selected in the Order drop-down list.
8. Click the Add Level button in the Sort dialog box. A new level of sorting is added as shown
10. Ensure that the Values option is selected in the Sort On drop-down list.
11. Ensure that the A to Z option is selected in the Order drop-down list.
12. Click the OK button. The data in the MemberDetails.xlsx workbook will be displayed, as
shown in the following figure.
7. Select the Custom List option in the Order drop-down list. The Custom Lists dialog box is
displayed, as shown in the following figure.
10. The data in the StaffDetails.xlsx workbook will be displayed in order of their month of
Equals: This condition filters the numeric data in the worksheet by filtering the details, which
correspond to the selected value.
Does Not Equal: This condition filters the numeric data in the worksheet by filtering the
details, which do not correspond to the selected value.
Greater Than: This condition filters the numeric data in the worksheet by filtering the
details, which correspond to the values greater than the selected value.
Greater Than or Equal To: This condition filters the numeric data in the worksheet by
filtering the details, which correspond to the values greater than or equal to the selected value.
Less Than: This condition filters the numeric data in the worksheet by filtering the details,
which correspond to the values less than the selected value.
Less Than or Equal To: This condition filters the numeric data in the worksheet by filtering
the details, which correspond to the values less than or equal to the selected value.
The custom filter feature on the text data is applied by selecting the following conditions:
Begins With: This condition filters the text data in the worksheet by filtering the details,
which correspond to the values that begin with the specified characters.
Ends With: This condition filters the text data in the worksheet by filtering the details, which
correspond to the values that end with the specified characters.
Contains: This condition filters the text data in the worksheet by filtering the details, which
correspond to the values that contain the specified characters.
Does Not Contain: This condition filters the text data in the worksheet by filtering the details,
which correspond to the values that do not contain the specified characters.
Equals: This condition filters the text data in the worksheet by filtering the details, which
correspond to the selected value.
Does Not Equal: This condition filters the text data in the worksheet by filtering the details,
which do not correspond to the selected value.
Filtering the Data in a Workbook (Example)
Prerequisite: To perform this task, you need to use the ProductsDetails.xlsx workbook. To
filter the data in a workbook, you need to perform the following steps:
3. Click the Sort & Filter drop-down button in the Editing group under the Home tab. The
drop-down list is displayed.
5. Click the drop-down button in the C1 cell. The drop-down list is displayed.
Prerequisite: To perform this task, you need to use the DivisionSales.xlsx workbook. To group
the data in a workbook, you need to perform the following steps:
4. Click the down arrow of the Group drop-down button in the Outline group. The drop-down
list is displayed.
16. After grouping, the data in the DivisionSales.xlsx workbook is displayed, as shown in the
following figure.
16. Click all the minus symbols in the outline pane. The DivisionSales.xlsx workbook is
displayed, as shown in the following figure.
17. Save and close the Microsoft Excel workbook.
Formatting Data
Consider a scenario where you are creating a workbook to track the monthly travel expense of
employees of a company. You want to ensure that in the expense column, only that data is
accepted, which exceeds $2500 per person. To accomplish this, you need to use the data
validation feature. In addition, you also want to highlight the rows that have the expense amount
greater than $5000. To accomplish this, you need to use the conditional formatting feature.
Data Validation
The data validation feature of Microsoft Excel allows you to create certain rules that dictate what
can be entered into a cell. For example, you may want to limit the data entry in a particular cell
to a number ranging 10 to 100. If a user tries to enter an invalid value, you can display a custom
error message. Data validation can be implemented in two ways:
4. Click the down arrow of the Data Validation drop-down button in Data Tools group. The
drop-down list is displayed.
5. Select the Data Validation option. The Data Validation dialog box is displayed, as shown in
the following figure.
14. Type Enter positive value in the Error message text box.
4. Click the down arrow of the Data Validation drop-down button in Data Tools group.
5. The drop-down list is displayed. Select the Data Validation option. The Data Validation
dialog box is displayed, as shown in the following figure.
6. Ensure that Settings tab is selected.
10. The drop-down list is displayed. Select the greater than option.
13. Click the down arrow of the Data Validation drop-down button in Data Tools group under
the Data tab. The drop-down list is displayed.
14. Select the Circle Invalid Data option. The data in the SalaryDetails.xlsx workbook is
displayed, as shown in the following figure.
15. Save and close the Microsoft Excel workbook.
Conditional Formatting
Consider the scenario of Alpha Supermart. The product details, such as the product name,
product category, unit price, and reorder quantity, are recorded in a worksheet. Abraham, the
Store Manager, wants to identify the products whose unit price is less than $500. For this
purpose, he can use the conditional formatting feature of Microsoft Excel, which will highlight
the cells that have the unit price less than $500. Conditional formatting highlights those cells,
whose data satisfy certain criteria, with some style to distinguish them from other cells. In
Microsoft Excel, the cells to be formatted may contain numeric or textual data. There are
different types of conditional formatting criteria, which can be applied on data:
Highlight Cell Rules: This type of conditional formatting is used to highlight the cells that
satisfy the predefined criteria, such as Greater Than, Less Than, Equal To, Text that Contains, A
Date Occurring, and Duplicate Values.
Top/Bottom Rules: This type of conditional formatting is used to highlight the cells with a
specified color or format, when their values satisfy the criteria, such as Top 10 items, Top 10%,
Bottom 10 items, Bottom 10%, Above average, and Below average.
Data Bars: This type of conditional formatting is used to distinguish each selected cell by
placing a bar corresponding to the value in the cell.
Color Scales: This type of conditional formatting is used to distinguish each selected cell by
coloring with a range of colors selected in the color scale.
Icon Sets: This type of conditional formatting is used to distinguish each selected cell by
placing an icon corresponding to the value of the cell. There are different types of predefined
icon sets, such as Directional, Shapes, Indicators, and Ratings.
Moreover, you can create your own conditional formatting criteria by using the New Formatting
Rule dialog box, as shown in the following figure.
To open the New Formatting Rule dialog box, you need to first click the Conditional
Formatting drop-down button under the Home tab, and then select the New Rule option. In the
New Formatting Rule dialog box, you can choose a rule from the Select a Rule Type section.
Based on your selection, you can set the format options that you want to apply on the cell
content. You can also delete the rules, which you have created, by using the Clear Rule option
in the Conditional Formatting drop-down button in the Home tab.
3. Click the Conditional Formatting drop-down button in the Styles group under the Home tab.
The drop-down list is displayed.
5. Select the Greater Than option. The Greater Than dialog box is displayed.
6. Type 9000 in the text box below Format cells that are GREATER THAN.
9. Click the OK button. The data in the FirstQtrSales.xlsx workbook will be displayed, as
shown in the following figure.
10. Save and close the Microsoft Excel workbook.
Relative referencing
Absolute referencing
Mixed referencing
3-D referencing
Relative Referencing In relative referencing, when the position of the cell containing
the formula changes, the reference also changes. For example, you have the cell, C3, with a
formula that references A3 and B3. When you copy the formula from C3 to C4, Microsoft Excel
updates the cell reference from A3 to A4 and B3 to B4 inside the formula, respectively, as shown
in the following figure.
Absolute Referencing
In absolute referencing, the cell references contained in the formula does not change even if you
copy the formula to another location. You can use absolute referencing in a formula by prefixing
the column name and the row number by the dollar ($) sign. For example, to refer to the cells,
A3 and B3, absolutely in C4, specify the cell names as $A$3 and $B$3. Thereafter, copy the
formula from C3 to C4. The reference used in the formula does not get changed, as shown in the
following figure.
Mixed Referencing
This referencing methodology uses both, relative referencing and absolute referencing. It has
either an absolute column and a relative row or an absolute row and a relative column. For
example, you have the cell, C3, with the formula that references A3 relatively and B3 absolutely.
Now, when you copy the formula from C3 to C4, the relative reference will change but the
absolute reference will remain the same, as shown in the following figure.
3-D Referencing
This referencing methodology refers to the same cell or range of cells in multiple worksheets. To
understand 3-D referencing better, consider a scenario where you have created a workbook that
contains worksheets for sales of every month. The B4 cell contains the total sales of a month in
each worksheet. Now, you want to find the total sales of the first quarter in the new worksheet,
Quarter_1. For this, you need all the total sales values of January, February, and March. You can
use 3-D referencing to add all the cell references of three sheets. To refer the cell references of
three sheets, you need to click the January worksheet tab, hold the Shift key, and then click the
March worksheet tab. The following figure shows the 3D referencing formula.
Defined Name
A defined name can be used to describe the meaning or content of a cell, range of cells, constant,
or formula by giving it a definitive name. You can define range names on the cells in order to
perform the operations in a more convenient manner, rather than using a cell name of each
individual cell in the calculations. You can use the defined names wherever you want to use the
actual cell address or the content. For example, the formula, =A10 * B10, is not meaningful
unless you know the meaning of the data in the cells, A10 and B10. However, if you assign
names to A10 as Income and B10 as TaxRate, you can write the formula as =Income *
TaxRate. You can assign name to a cell or range of cells by using Define Name button in
Formulas tab.
4. Click the down arrow of Define Name drop-down button in the Defined Names group. The
drop-down list is displayed.
5. Select the Define Name option. The New Name dialog box is displayed, as shown in the
following figure.
7. Click OK button.
14. Select the B8 cell and type the formula =SUM(qtr_1,qtr_2,qtr_3,qtr_4) then press the
Enter key.