Experiment

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Experiment – 7 Data Handling

1. Data Validation

Data validation is a feature in MS Excel used to control what a user can enter in a cell of an excel sheet.
For restricted entries in a sheet, such as a date range or whole numbers only. We can even create
dropdowns, which save unnecessary space and show the values in a single cell. Also, we can create a
customized message which will appear if the user inserts any incorrect value or an incorrect format.

We can restrict a user from entering a whole number between 0 and 10.

Execute the Below mentioned steps for the creation of the data validation rule in excel:

Step 1: Select B2 Cell.

Step 2: Go to the Data tab, and click on Data Validation from Data in the toolbar.

Step 3: A data validation Pop-Up will open:


Step 3.1: On the Settings tab, Click on Allow drop-down under validation Criteria.

Step 3.2: Select the Whole number, then Some more required options will be enabled.
Step 3.3: Select between from the drop-down of the Data list, Enter the Minimum and Maximum number
for restriction. And click ok.

Step 3.4: All settings will apply to the selected cell.

Now Enter 1 in cell B2- It will allow a user to enter any whole number from 0 to 10.
Now Enter 11 in cell B2- It will throw by default error.

Example #2 – Set Input Message and Error Alert

We can restrict a user to enter a limited text.

Step 1: Select B5 Cell from Example 2 Sheet.

Step 2: Click on the data validation tool from the Data Menu Bar and select Text Length in Allow
drop-down.
Step 3: Select equal to from the data list drop-down.

Step 4: Enter your desired length of the password (as an example 11).

Step 5: Click on the Input Message tab and provide a message displayed on the selection of cell.
Step 6: Click on the Error Alert tab, provide a Title and the Error message, which will be displayed if a
user entered an invalid length password.

Step 7: After that, click the Ok button, and the setting will be applied to the selected cell. On the Selection
of Cell, an Input message will be displayed.
Enter a text which has a text length of 11. It will be selected successfully.

Now enter an invalid password. It will throw the described error message.

Valuation criteria of excel data validation Settings

● Any Value – To provide any type of data.


● Whole Number – Enter only whole numbers.
● Decimal – Enter only decimal numbers.
● List – Pick data from the drop-down list.
● Date – Accept the only date.
● Time – Enter only time.
● Text Length – Fixed the length of the text.
● Custom – Enter a custom formula.

2. Data Auditing

Excel is so popular throughout the world because of its wide range of formulae, functions, and macros. It
can almost surely handle every task in the world with ease. All these formulae are easy to use, but it
becomes a tough job whenever you are using multiple formulae in combination. It sometimes does not
give the result as expected. It becomes easy to trace back the errors if formulae are quite simple.
However, when we start creating some complex formulae, it becomes a hectic job to track the errors with
such formulae. Thus, it becomes an important job for the user to be able to trace back the errors.
Fortunately, Excel provides a variety of built-in tools that allow you to audit the errors with formulae and
correct the same.

We have six main tools under Excel for formula auditing listed below:

● Trace Precedents
● Trace Dependents
● Remove Arrows
● Show Formulas
● Error Checking (includes Error Checking, Trace Error, Circular References)
● Evaluate Formula

Example #1 – Trace Precedents

Trace precedents can be defined as the cells which are affecting the values/formulae under the selected
cell. Suppose we have five principle amounts that we can invest with a rate of interest of 12% and a
period of 6 years. We have calculated the interest amounts for all five principles using a simple formula
Principle*Interest Rate*Period(in years). See the screenshot below:

Now, if we click on cell A6 and press F2, we can see the formula we used to capture Interest Amount 1.
This clearly shows us that Interest Amount 1 is based on Principal Amount 1 Value (A2) and Interest Rate
(H2) as well as Period (I2). However, Excel has its own way to show this relationship through cell
precedents under the formula auditing group.

Step 1: Select cell A6 from the current worksheet and click on the Formulas tab at the Excel ribbon.

Step 2: Once you click on the Formulas tab, you can see the Formula Auditing group under it with various
formula auditing options available.

Step 3: Click on the Trace Precedents option under the Formula Auditing group, and it will make a
connection between all the cells that are affecting the currently selected cell through blue-colored arrows
as shown below:
Trace Precedents help you in finding out what cells are associated with the formula using which the
values are obtained.

Example #3 – Trace Dependents

Now, suppose we click on any cell, and we wanted to check the cells that have a dependency on the
currently selected cell. Can we do that in Excel? Surely, we can do this. Trace Dependents is the function
that shows you a relationship between the selected cell and all other cells which have a dependency on the
selected cell.

Suppose we select the cell H2 (Interest Rate). And wanted to check what are all the other cells that have a
dependency on H2. We can do this in Excel.

Step 1: Select cell G2 in your excel sheet.

Step 2: Now click on the Formulas tab on the Excel ribbon and select Trace Dependents to see what are
all the cells dependent on G2.

Once you click on Trace Dependents, you’ll see all the cells that have a dependency on G2, and they will
be connected with blue arrows.

Example #4 – Show Formula

See Formulas is an exciting feature within Excel that shows you the formulas under all cells (formulated)
instead of the values.

Go to the Formulas tab through the Excel ribbon and click on the Show Formulas button under the
Formula Auditing group to see all the formulas in the current Excel sheet.
Example #4 – Error Checking

Suppose we have two numbers Number 1 and Number 2, respectively, as shown in the image below:

Now, we call a function that takes these two cell references and should give some output. I will be using
the ROUNDUP function in Excel. See cell B3 for more references.

Excel has an Error Checking option with it.

Go to the Formula Auditing group and click on the Error Checking button.

Error Checking dialogue box will open up as shown below:

You can see online help on this error by clicking Help on this Error button, or you can see the calculation
steps involved in this error by hitting Show Calculation Steps, or you can ignore the error or Edit the
formula as well.
Click on Help on this Error button, and you’ll be redirected to Office Support online page as shown
below:

From here, I get that the #DIV/0! An error occurs when we try to divide some number with zero. I will
change the value of Number 1 under cell B1 and see how the formula works in B3.

Example #5 – Evaluate Formula

You can also evaluate any formula in Excel to see how that works. Just click on the Evaluate Formula
button under the Formula Auditing group, and then you’ll see a new window where you can click the
evaluate button and see the actual evaluation of the formula step by step.
This is how the Auditing Excel formula works under Excel.
3. Data Protection

Excel gives you the ability to protect your work, whether it’s to prevent someone from opening a
workbook without a password, granting Read-Only access to a workbook, or even just protecting a
worksheet so you don’t inadvertently delete any formulas. In this topic, we’ll discuss the various ways
you can utilize the primary options to protect and distribute your Excel files.

Following are the different options available for protecting your Excel data:

File-level: This refers to the ability to lock down your Excel file by specifying a password so that users
can’t open or modify it. You have two choices here:

i) File encryption: When you choose this option, you specify a password and lock the Excel file. This
prevents other users from opening the file. For more information, see Protect an Excel file.

ii) Setting a password to open or modify a file: You specify a password to open or modify a file. Use
this option when you need to give Read-only or edit access to different users. For more information, see
Protect an Excel file.

● Select File > Info.


● Select the Protect Workbook box and choose Encrypt with Password.
● Enter a password in the Password box, and then select OK.
● Confirm the password in the Re Enter Password box, and then select OK.

ii) Mark as Final: Use this option if you want to mark your Excel file as the final version and want to
prevent any further changes by other users. For more information, see Add or remove protection in your
document, workbook, or presentation.

iii) Restrict Access: If your organization has permissions set up using Information Rights Management
(IRM), you can apply any of the available IRM permissions to your document. For more information, see
Add or remove protection in your document, workbook, or presentation.

iv) Digital signature: You can add digital signatures to your Excel file. For more information, see Add or
remove a digital signature in Office files.

2. Workbook-level: You can lock the structure of your workbook by specifying a password. Locking the
workbook structure prevents other users from adding, moving, deleting, hiding, and renaming worksheets.
For more information on protecting workbooks, see Protect a workbook.
3. Worksheet-level: With sheet protection, you can control how a user can work within worksheets. You
can specify what exactly a user can do within a sheet, thereby making sure that none of the important data
in your worksheet are affected. For example, you might want a user to only add rows and columns, or
only sort and use AutoFilter. Once sheet protection is enabled, you can protect other elements such as
cells, ranges, formulas, and ActiveX or Form controls. For more information on protecting worksheets,
see Protect a worksheet.
4. Data Consolidation

Consolidate in Excel is used to combine the data of more than 2 workbooks which is available in the Data
menu tab under the Data tools section with the name Consolidate. For this, we must have the same type of
data in different workbooks. Although different data sets will also work, there will not be proper
alignment in consolidated data. Choose any mathematical function which we want to execute at last. Then
select all the data using references from all the workbooks and click on OK. This will combine the
selected tables with the execution of the chosen mathematical function at the end.
Assume we have received data from three worksheets in the same workbook, as shown below.
below.

We have sales data of four zones in three different sheets.

Now we need to collate this data into a single worksheet. We have created a template named
“Consolidated Sheet” for this in a separate sheet.
We must follow the below steps.

1. We must first select cell B2 in the “Consolidate Sheet.”

2. Then, go to the “Data” ribbon and click on “Consolidate.”


3. Once we click on “Consolidate,” we will get the “Consolidate” window as shown below.

4. The first item in the window above is Excel’s “Function” drop-down list. This drop-down
list can select any function to consolidate the data.

Based on the type of consolidation we need to perform, we must select the desired function. In
this example, we want to summarize the total sales of three different worksheets. So we will
choose the SUM function in excel
5. , which is the default.

6. Next, we need to add the reference of each worksheet sale number cell. Then, click on the
“Reference” box and select the sales number in the worksheet “File 1.”
7. Once the reference is selected, click on “Add.” As a result, it will add your chosen references
to all references.

8. By placing a cursor back to reference, we will go to the second worksheet, “File 2.”
9. It will automatically select the range of cells we set in the previous worksheet. But, again, we
must click on “Add” to add the reference.

10. Finally, we will repeat the same step for the “File 3” worksheet.
11. Now, we are done with the reference process. Click on “OK” to get the consolidated
summary in the “Consolidate Sheet.”

You might also like