Unit 4 Excel
Unit 4 Excel
When you have data that needs to be transferred to another system, export it from Excel in a
format that can be interpreted by other programs, such as a text or CSV file.
The file type you select will depend on what type of file is required by the program that
will consume the exported data.
8. Click Yes.
Import Data
Excel can import data from external data sources including other files, databases, or web pages.
If you have data to import from Access, the web, or another source, select one of those
options in the Get External Data group instead.
Because we've specified the data is separated by commas, the delimiter is already set. If
you need to change it, it can be done from this menu.
8. Click Load.
*************************************************************************************
Cleaning data in Excel
1) Get Rid of Extra Spaces:
Extra Spaces are difficult to spot & correct. Multiple spaces may be easy, but trailing spaces are
pretty tough. Trailing spaces are blank spaces at the end of the statement or word which are not
followed by any other character.
Here’s an easy way to spot & eliminate such errors:
Syntax: TRIM(text)
Steps:
NOTE:
At the last step, if “Enter” only is pressed, then the value will be inserted only in the active cell.
So remember to press “Ctrl+Enter.”
3) Convert Numbers Stored as Text into Numbers:
When we import data from files, other sources, databases, text, etc. During transit, data might get
affected. Also, some have a habit of using an apostrophe before numerical values, which is
considered as text in Excel. Such minor data conversion can drastically affect calculations.
Suppose there are three values “70, ’70, 80”. When we compare 70 and 80 (70<80), the result is
“TRUE.” But when we compare “apostrophe 70 & 80” (‘70<80), the problem starts. Here the
result will be FALSE as the text will be rated higher than any number. To eliminate such errors,
here’s a trick.
Steps:
Here it multiples every single value to “1”. And anything multiplied by 1 is the same number.
But this trick also takes care of the apostrophe numerical.
4) Remove Duplicates:
Elimination of duplicate data is necessary for the creation of unique data & less usage of storage.
In duplication, you can either highlight it or delete it.
A) Highlight Duplicates:
● Select the data & go to Home > Conditional Formatting > Highlight Cell Rules > Duplicate
Values
● A dialogue box will appear (Duplicate Values), Select Duplicate & formatting color
● Press OK
● All duplicate values will be highlighted!
B) Delete Duplicates:
5) Highlight Errors:
While creating reports or dashboards, you might face a few arithmetical errors (like divisional
errors). Such errors are easy to spot if the Data is small. But for big data, it’s complicated. So to
get rid of such mistakes, you can go for two ways: Conditional Formatting or Go to Special.
A) Using Conditional Formatting:
All the cells with errors are highlighted & now are easy to spot.
B) Go to Special:
*************************************************************************************
Data Validation
Data Validation Example | Create Data Validation Rule | Input Message | Error Alert | Data
Validation Result
Use data validation in Excel to make sure that users enter certain values into a cell.
4. Click OK.
Note: to remove data validation from a cell, select the cell, on the Data tab, in the Data Tools
group, click Data Validation, and then click Clear All. You can use Excel's Go To Special
feature to quickly select all cells with data validation.
*************************************************************************************
Data Validation Criteria Examples
Use Data Validation to allow specific entries in cells on a worksheet. For example, show a
list, limit the cells to whole numbers, or text of specific length. This tutorial shows the
available settings, with an example of each setting.
Whole Number
If you allow Whole numbers, you can set or exclude a range of numbers, or specify a minimum
number or maximum number.
To set the allowed values, you can
For example, in this example, the MAX and MIN functions set the minimum and maximum
values, based on values in cells J5:J9.
● Minimum: =MIN(J5:J9)
● Maximum: =MAX(J5:J9)
Decimal
If you allow Decimals, you can set or exclude a range of numbers, or specify a minimum number
or maximum number.
In this example, values are entered for the minimum and maximum.
*************************************************************************************
How to Create Macros in Excel: Step-by-Step Tutorial (2022)
A macro is a small program or set of actions that you can run repeatedly. Excel macros are used
to automate repetitive tasks to save a lot of time and hassle.
For example, open and take a look at the practice Excel workbook.
2. Next, click on the Macros button on the right side of the View ribbon
For this Excel macro tutorial, you only need to save the macros in the current Excel file.
4. Select Store macro in: This Workbook then click the OK button.
Excel is now recording your actions to create a macro.
5. Select Columns A & B and then right-click on the highlighted Column Bar to Hide them.
6. Then select Column I and press Ctrl + Shift + Right Arrow to include all remaining columns
on the right.
2. This opens the Macro window. Saved macros will be listed here and you can Run whichever
one you need.
You can also click on Edit to view the VBA code window.
Great work!
Now you have two recorded macros that can be executed.
The macro executes the actions recorded earlier and hides the unnecessary columns.
You can also run macros from the View ribbon.
This will be your HIDE button. Place it between columns A & B so it will be hidden with the
columns when the macro runs.
4. To assign a macro, right-click the shape and select Assign Macro.
5. In the Assign Macro window, select Hide_Columns and click OK.
The Hide button now works!
Now, do the same for the Unhide_Columns macro.
6. Create another rectangle button and label it “UNHIDE”.
7. Repeat Steps 4 & 5 but this time, assign the Unhide_Columns macro.
Alright!
Now you can quickly run your macros using the HIDE and UNHIDE buttons.
3. Start recording with the Record Macro button on the Developer tab.
Or, you can also click the Record Macro button on the Status Bar.
When selecting cells or expanding selections while recording a macro, it is best to use keyboard
shortcuts.
This is so that Excel can record the selections as relative references.
For example, if you select Row 4 by clicking on the Row Bar, Excel will record this as an
absolute reference. This means it will always select Row 4 regardless of the currently Active
Cell.
When you use the Shift + Space Bar shortcut instead, it tells Excel to select the row of the
current Active Cell.
All done!
*****************************************************************************
Scenario Manager in Excel
Share on Facebook Share on Twitter
Share
● Select the cells that are not calculated i.e., (the inputs) C5, C6, C7, C8, C9, C10, C11, C14.