Unit II
Unit II
Unit-II
MICROSOFT EXCEL
What is Excel?
Excel is pronounced "Eks - sel"
The first version was released in 1985 and has gone through several changes over
the years. However, the main functionality mostly remains the same.
Analysis
Data entry
Data management
Accounting
Budgeting
Data analysis
Visuals and graphs
Programming
Financial modeling
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 1
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
To-do list
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 2
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
There are various methods to select a cell or multiple cells in Excel, such as through a mouse
or by keyboard shortcut keys or a combination of both. As Microsoft Excel users, it is
essential to quickly select cells, rows, columns, table cells present in an Excel worksheet.
Selection assists the users in various tasks such as insertion, deletion, and formatting of
multiple rows and columns in an Excel worksheet. Whenever you select any cells, row,
column, or cell range, you will notice that the color of the selected cell(s) will change and
get highlighted compared to the rest of the cells.
This tutorial will discover the various ways for selecting cells, row columns, tables, and
the range of an Excel worksheet.
For example:
We want to select the B 4 cell. So we will keep our cursor to that particular cell address
to select it.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 3
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
1. Put your mouse cursor on the first cell from where you want to start your selection,
i.e., B1.
2. Press your mouse button and drag the mouse cursor till cell E10. It will include all the
in-between cells.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 4
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
3. Leave the mouse cursor, and the cells B1: E10 will get selected.
Select Rows/Columns
While working with Excel many times, the user requires selecting an entire row or column
for various operations such as hiding or deleting the row or column, applying some
conditional formatting, highlighting the data, etc.
Unlike you select a cell in Excel by placing the mouse cursor on the respective cells, you
can also select any row or a column by moving your mouse on the row or column.
o Place your mouse cursor on the top of your row number. For example, if you
can second the select row, so bring your cursor to Row 2.
o Double click on the row number, and it will select the entire row. In the
below image, you can see the entire Row 2 is selected (Excel highlights the
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 5
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
As in the above steps, we have seen how to select an entire row in Excel. Similarly, you
can select a column as well. Follow the below steps to select an entire Column in Excel:
o Place your mouse cursor on the top of your Column alphabet. For example,
if you can second the select column, so bring your cursor to Column B.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 6
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
o Double click on the column alphabet, and it will select the entire column. In
the below image, you can see the entire Column B is selected.
We work on Excel and manipulate the data. Sometimes we want to select multiple rows/
columns together to apply the same operation on adjacent rows/columns at once.
For example, suppose that you want to select row numbers 5, 6, and 7 together.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 7
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
o Bring your mouse cursor over row number 5 in the Excel worksheet.
o Double click the left cursor to select Row 5, but keep the mouse left button
pressed as we have to select multiple rows.
o While pressing the mouse drag your cursor down till you reach Row 4. At
this point leave the mouse pointer and the three adjacent rows will be selected.
Following the above steps, you can select multiple columns as well. Make sure to click on
the column alphabet instead of row number and drag till the last column selection.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 8
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Selecting non-adjacent rows/columns is simple. However, the above select and drag
technique won't work as restricted to adjacent cells, rows, or columns. To select random
cells, rows, or columns in Excel, we have to use a keyboard and mouse combination. Let's
say we want to select random rows such as row numbers 5, 7, 9, 10.
1. Bring your mouse cursor on the top of your first-row number, i.e., row 5 in
Excel. Click on the row number to select it.
3. While pressing the Control Key, drag your mouse cursor to the desired row numbers to
select them. First, we dragged it to Row 7 and clicked on row number. As you can see,
it got selected.
4. Leave the mouse button, move your mouse cursor to Row 9, click on the row number,
and select it.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 9
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
6. Once you have selected the required rows, leave the mouse and the CTRL-key.
Unlike when you have selected the adjacent rows using a keyboard and mouse combination,
you can apply the same method to select multiple non-adjacent columns.
You manually select the table cell using the click and drag option. But it could be
time-consuming, and with large tables, it becomes damn hard. However, with the help of
Excel keyboard shortcuts, selecting the table cells of the worksheet can be done in a blink
of time.
1. Go to your table and select any cell within your Excel table data set
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 10
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
2. Press the Ctrl key and alphabet Akey from your keyboard.
Note: CTRL + A would select all the cells within the table data set unless and
until Excel runs into a blank row or column as it would consider the blank row
or blank column as the end of the data set and won't stop the selecting
operation.
In some cases, you may require to select multiple continuous or non-continuous cells, rows,
or columns located at a distance in your Excel worksheet. Of course, those cells can be
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 11
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
"In Excel, Name Box is the small rectangular field placed on the top left corner of your
worksheet."
In general, whenever you select any cell in your Excel worksheet, the cell reference (of the
active cell) is shown in the name box. Though the vice versa is also applicable, i.e.,
whenever you type any cell address in the name box, it selects all the mentioned cells or
cell range."
For example: Let's suppose we have to select multiple non-contiguous cells, unlike B12,
N43, and Z50. If you notice the cells mentioned earlier are far off each other, it would be
cumbersome and time-consuming if we select it manually.
So let's try selecting the cells using the name box instead. Follow the below steps.
1. With the help cursor, click on the name box mounted at the top left corner of your Excel
worksheet.
2. Types in the cell address that you want to select. Separate the cell references with a
comma in case you want to select multiple cells. For example, in our case, we will type
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 12
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
3. Once done, press the Enter button. It will instantly select the entered cells.
Note: In the Name Box bar, only the cell references of the active cells are
visible. It does not represent the total cells you selected; it only displays the
active cell, so don't get confused.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 13
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
This keyboard
combination selects the
cells in selected rows that
6. Ctrl, \
do not match the formula of
your current Excel
worksheet.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 14
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Now that you know the fundamentals of Data Formatting in Excel, you will learn
how to implement formatting in real-time.
Moving ahead, you will now learn how to implement formatting in Excel based on
the number or datatype formatting in the next section.
Number Formats might sound simple, but improper number formats may lead to
improper reports in the end. A simple scenario can explain the situation in a better
way.
Now, imagine you work with an automotive store, and your store manager requests
you to find the customer that made the highest purchase in the month to award
the customer a discount on his next purchase.
Let us assume all transactions are saved in dollar format except the one. In a hurry,
you missed adding dollar format to it, which is the highest transaction made in the
month. This simple scenario explains how easily things could go sideways.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 15
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
In this section, you will learn what is number Formatting in Excel and how to add
number formatting in Excel?
Select a cell or a cell range or the complete column where you wish to add
Number Formats
In the Number Group, select the drop-down to access the Number formatting
as shown below.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 16
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
it’s time to dig a little deep and understand the variety of formats available in Excel.
General
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 17
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
General is a number format selected as the default by excel for any number you
type into the spreadsheet. The number appears the same way you type it without
additional decimals or modifications.
Number
Number Format is exclusively used when you are working with numbers. The
Number Format will add decimal points to your data to keep it more accurate, and
you can also customize the number of decimal points you wish to have.
Currency
Currency Number Format is used when you want to represent numbers in the form
of currency. For example, annual investment data. You might use dollars to represent
such kinds of data.
Accounting
Accounting is completely similar to currency. You can use the accounting Number
Format to add decimal places to your currency to make it more accurate.
Date
Time
The Time Format converts the general default number format to the time format.
Percentage
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 18
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
The Percentage Data Format represents the values in terms of percentages. For
example, the Excel spreadsheet calculates the percentage values and multiples by
100 and denotes the decimal values in a percentage format.
Fraction
The Fraction Format displays the general number in the form of a fraction according
to the type of fraction you chose.
Scientific
The Scientific Number Format differs slightly from currency or a general or decimal
number. The Scientific Number Format has an exponential number that indicates
the power of a number. Apart from exponents, the scientific number format also
includes trigonometry, calculus, roots of a number, etc.
Text
The text includes the textual type of data. Here, Excel treats any number of data
you type as text format and keeps it the way it is without adding any decimals or
mathematical symbols.
Special
You also have symbols besides numbers, text, and scientific notations. These symbols
are entitled as special symbols. While using these symbols, you need to select the
Format of the special symbol.
Custom
Apart from all the available options, Excel also provides its users with a customizable
option that will help them use existing formats and customize them to create a
completely new one.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 19
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
So far, you have learned about number Formatting in Excel. Apart from number
formatting, you can also carry out formatting at the cell level. You will now learn
Cell Formatting in Excel in the next segment of this tutorial.
Cell Formatting in Excel is a little different from number formatting in Excel. Cell
formatting is related to text alignment, color, font, cell background color, images,
etc.
Navigate to the Home tab and search for the Font group.
Click on the drop-down icon, and Excel will provide you with a wide variety
of font options, as shown below.
After the Font option, you can go through the font color, bold, italic, and underline
options along with the text alignment in the same Home tab. A little towards the
right side in the alignment group, you have text alignment, text wrapping, and text
indentation options, as shown below.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 20
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
The Text color option will help users customize the text color in Excel with various
color options, as shown below.
The Cell background color option will help users modify the cell background color
in the spreadsheet, as shown below.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 21
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
The spreadsheet borders option will allow users to add cell borders as per the
requirement of the users.
You have the clipboard group on the left side of the font tab. The clipboard group
will help you with a variety of paste options. The copied text on the clipboard can
be pasted, or you can also use a custom paste option.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 22
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
On the right side of the Number Format Group, you have Conditional Formatting,
Cell Formatting, and Table Formatting options, as shown below.
The Conditional formatting option will allow the users to highlight or mark cells
on excel spreadsheets based on logical functions and formulae, as shown below.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 23
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
The Table Formatting in excel will allow you to modify the tabular data in Excel
with various options, as shown in the image below.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 24
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
The Cell Formatting option in Excel will allow users to modify individual cell
background colors per the user requirements, as shown below.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 25
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 26
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Excel will start the correct the Spelling mistakes. It checks for spelling from the active
cell point will continue till the end of worksheet.
After clicking on the Spelling, Spelling: English (United States) dialog box will
appear.
Before to correct the wrong spelling dialog box will provide the suggestion word you
can select appropriate words form the list otherwise you can ignore. If you are sure
about the spelling is correct and not available in this tool then you can add the word
in dictionary by using the Add to Dictionary option button.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 27
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Click on Change All button, after completed the all spelling check you will get the
popup, click on ok.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 28
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
To research for the word, you have to enter the word in the Search for Box, and
research.
Thesaurus Option: - This option is used to find out words with similar meanings in
Microsoft Excel.
To use this function go to Review Tab, click on Thesaurus in the Proofing group.
Let’s take an example and understand how we can find out the different words of
same meanings.
Go to Review Tab, Click on Thesaurus in the Proofing Group.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 29
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
This is the way we can use the Thesaurus for find out the fit word for a sentence
in Microsoft Excel 2010 and 2013
Function is a predefined formula already available in Excel. Functions perform specific calculations in a particular order
based on the specified values, called arguments, or parameters.
For example, instead of specifying each value to be summed like in the above formula, you can use the SUM function to add up
a range of cells: =SUM(A2:A4)
You can find all available Excel functions in the Function Library on the Formulas tab:
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 30
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
There exist 400+ functions in Excel, and the number is growing by version to version. Of course, it's next to impossible to memorize
all of them, and you actually don't need to. The Function Wizard will help you find the function best suited for a particular task,
while the Excel Formula Intellisense will prompt the function's syntax and arguments as soon as you type the function's name preceded
by an equal sign in a cell:
Clicking the function's name will turn it into a blue hyperlink, which will open the Help topic for that function.
Tip. You don't necessarily have to type a function name in all caps, Microsoft Excel will automatically capitalize it once you finish
typing the formula and press the Enter key to complete it.
SUM
The first Excel function you should be familiar with is the one that performs the basic arithmetic operation of addition:
SUM(number1, [number2], …)
In the syntax of all Excel functions, an argument enclosed in [square brackets] is optional, other arguments are required. Meaning,
your Sum formula should include at least 1 number, reference to a cell or a range of cells. For example:
=SUM(B2:B6) - adds up values in cells B2 through B6.
=SUM(B2, B6) - adds up values in cells B2 and B6.
If necessary, you can perform other calculations within a single formula, for example, add up values in cells B2 through B6, and
then divide the sum by 5:
=SUM(B2:B6)/5
To sum with conditions, use the SUMIF function: in the 1st argument, you enter the range of cells to be tested against the criteria
(A2:A6), in the 2nd argument - the criteria itself (D2), and in the last argument - the cells to sum (B2:B6):
=SUMIF(A2:A6, D2, B2:B6)
In your Excel worksheets, the formulas may look something similar to this:
Tip. The fastest way to sum a column or row of numbers is to select a cell next to the numbers you want to sum (the cell immediately
below the last value in the column or to the right of the last number in the row), and click the AutoSum button on the Home tab,
in the Formats group. Excel will insert a SUM formula for you automatically.
AVERAGE
The Excel AVERAGE function does exactly what its name suggests, i.e. finds an average, or arithmetic mean, of numbers. Its syntax
is similar to SUM's:
AVERAGE(number1, [number2], …)
Having a closer look at the formula from the previous section (=SUM(B2:B6)/5), what does it actually do? Sums values in cells B2
through B6, and then divides the result by 5. And what do you call adding up a group of numbers and then dividing the sum by
the count of those numbers? Yep, an average!
The Excel AVERAGE function performs these calculations behind the scenes. So, instead of dividing sum by count, you can simply
put this formula in a cell:
=AVERAGE(B2:B6)
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 31
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
To average cells based on condition, use the following AVERAGEIF formula, where A2:A6 is the criteria range, D3 is he criteria,
and B2:B6 are the cells to average:
=AVERAGEIF(A2:A6, D3, B2:B6)
Useful resources:
MAX function - find the highest value.
MAX IF formula - get the highest number with conditions.
MAXIFS function - get the largest value based on multiple criteria.
MIN function - return the smallest value in a data set.
MINIFS function - find the smallest number based on one or several conditions.
While the COUNT function deals only with those cells that contain numbers, the COUNTA function counts all cells that are not blank,
whether they contain numbers, dates, times, text, logical values of TRUE and FALSE, errors or empty text strings (""):
COUNTA (value1, [value2], …)
For example, to find out how many cells in column B contain numbers, use this formula:
=COUNT(B:B)
To count all non-empty cells in column B, go with this one:
=COUNTA(B:B)
In both formulas, you use the so-called "whole column reference" (B:B) that refers to all the cells within column B.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 32
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
The following screenshot shows the difference: while COUNT processes only numbers, COUNTA outputs the total number of non-blank
cells in column B, including the the text value in the column header.
Before we learn how to count cells with text in Excel, let us refresh the concept
of COUNT in Excel. Let us see what COUNT is and how Excel counts the values.
Counting is one of the most commonly used functions in Excel which provides a
numerical summary of the total values which might be useful in a variety of places.
In simpler terms, Excel counts how many times a value appears in a column or row.
In Excel, you can count the number of cells or the values it houses by using functions.
Excel has a variety of functions that help in counting. Functions like COUNT and
COUNTA are used to count all the cells in a particular range or select cells which
house a particular value. On the other hand, COUNTIF and COUNTIFS functions
count cells only if they satisfy a particular value.
In the case where we want to count the number of cells with text in Excel, the
function COUNTIF/COUNTIFS is the best choice. Using these functions, you can set
criteria to the function so it counts only the cells which house the text values in
the cell.
Texts are also called strings in Excel. When it comes to technological terms, strings
are a block of text which might contain any identifying values. They can be
individual values like name or address, or they can be a variable that points to
another constant.
In Excel, they are usually written with alphanumeric characters which are enclosed
by double quotation marks or can be written with an apostrophe. Additionally, they
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 33
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
can be a result of logical functions like TRUE or FALSE, or may even be special
characters like !, @, #, and $.
To count the cells with text in Excel, choose a destination cell and enter the
formula =COUNTIF(range,criteria). Here, the range denotes the array of cells within
which you want the function to act. The criteria variable denotes the condition to
satisfy when counting the values.
Consider the below given example. To find the cells with text values in a given range,
enter the formula =COUNTIF(A3:A10,”*”). The function COUNTIF acts on the cell
range A3 to A10 and finds the text values. The * represents the wildcard element.
The * symbol specifies anything other than numbers to be counted, including blank
spaces and special characters. However, this method does not count logical values.
To count the cells which have text value in them, enter the
formula =COUNTIF(range,criteria) in the destination cell. This is the same as the
previous case, but adding wildcard “?” together with “*” only counts the cells
which have text values.
Consider the below given example. To find the cells with text values in a given range,
enter the formula =COUNTIF(A3:A12,”?*”). Here, the function COUNTIF counts the
number of cells in the range of cells A3 to A12. Whereas for the criteria parameter,
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 34
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
instead of just passing “*” which counts all the cells with text values, adding
the “?” wildcard to the criteria counts the cells which have at least one character.
Using this method, you’ll learn how to count specific words in Excel. To count the
cells with the specific value, you can just enter the text to count within quotations
when you pass the criteria parameter.
Let me show you an example. Suppose you want to count the occurrences of the
word “two” in a range of cells. You can just enter the formula in
the =COUNTIF(A3:A12,”two”) to count the occurrences of the word “two” in the
given range of cells A3 to A12.
Imagine you want to count the number of cells that contain the text starting with
any particular letter or character. Say, you want to count the number of cells that
starts with the letter “t”, then you can use the “*” wildcard.
Consider the example, in the cell range A3 to A12 you want to count the number
of cells which start with the letter “t”. Then, enter the
function =COUNTIF(A3:A12,“t*”) in the destination cell.
How to count cells with text in Excel with particular value using * wildcard
The resultant value is 2. This denotes that when you want to find the cells which
start with the letter “t”, you can enter the value “t*” in the criteria parameter.
As a result, the COUNTIF function counts the cells which start with the letter “t”
irrespective of the number of characters that follow them.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 35
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Another case to use the wildcard is to count any one particular value. For example,
if you want to find the occurrences of a three-letter word that have the starting letter
“t” and ends with “o”, you can use the “?” wildcard. As the “*” wildcard replaces
any number of characters, the “?” wildcard only replaces one character.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 36
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Now if you want to get the first “Geeks” from “Geeksforgeeks” in B2.
Let us follow the next step.
Enter =LEFT(B2,5)
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 37
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Now if you want to get the last geeks from “Geeksforgeeks” in B2. Let
us follow the next step.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 38
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Enter Formula
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 39
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Geeks Returns
Now if you want to get the character “for” which is located in the middle
of our text “Geeksforgeeks” in B2. Let us follow the next step.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 40
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Enter Formula
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 41
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Now if you want to know how many characters are in the text
“Geeksforgeeks”. Let us follow the next step.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 42
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
We will enter =LEN(B2) in the B3 cell. Excel will count how many
characters are in the text.
Enter Formula
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 43
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
13 Returns
Now if you want to find “for” in geeksforgeeks in B2. Let us follow the
next step.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 44
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Enter Formula
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 45
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
TRIM
If your obviously correct Excel formulas return just a bunch of errors, one of the first things to check is extra spaces in the referenced
cells (You may be surprised to know how many leading, trailing and in-between spaces lurk unnoticed in your sheets just until
something goes wrong!).
There are several ways to remove unwanted spaces in Excel, with the TRIM function being the easiest one:
TRIM(text)
For example, to trim extra spaces in column A, enter the following formula in cell A1, and then copy it down the column:
=TRIM(A1)
It will eliminate all extra spaces in cells but a single space character between words:
LEN
Whenever you want to know the number of characters in a certain cell, LEN is the function to use:
LEN(text)
Wish to find out how many characters are in cell A2? Just type the below formula into another cell:
=LEN(A2)
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 46
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Please keep in mind that the Excel LEN function counts absolutely all characters including spaces:
Want to get the total count of characters in a range or cells or count only specific characters? Please check out the following resources.
The Excel Substitute function replaces a part of the text in a string with
some other text. SUBSTITUTE function is used to clean data by
substituting one or more characters from imported data. For example,
if we have imported some data from a PDF file in a format 458-299-605,
we apply the SUBSTITUTE function to transform it into 458299605.
The Excel SUBSTITUTE function replaces or substitutes the text strings with other text strings.
You can use the SUBSTITUTE function to replace the text based on matching (remember,
it doesn't work with position). You can also replace one or more text strings with no data;
you need to pass an empty string ("") in the argument. SUBSTITUTE is an inbuilt function
categorized under Excel Text Functions.
NOTE: A single SUBSTITUTE function can only replace one text value at a time.
However, you can nest the SUBSTITUTE function inside of itself to replace
more than one string.\
Syntax
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 47
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Parameters
o Text (Required): This argument specifies the text in which you want to
substitute the text.
o Old_Text (Required): This argument specifies the old text which you want to
replace.
o New_Text (Required): This argument specifies the new text with which you
want to replace your original text.
o Instance_number (optional): The occurrence of old text which you want to
replace with new text. When you skip the instance parameter, all occurrences
of the old_text argument are replaced with the new_text argument.
Bob Bot
Bumble 1 Tumble
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 48
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
We will type our SUBSTITUTE formula in this column and place the SUBSTITUTE data for
different text values.
NOTE: Format the helper column and match it with the match column to make
your Excel sheet more attractive.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 49
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
o Text: Here we will specify the text that we want to change. It is the reference
cell of the string, i.e. B4 OR HUT, so our formula becomes: =SUBSTITUTE(B4,
o Old_text:In this parameter, we will specify the string (of our existing text
string) we want to change. Here, in our case, we want to change the string
b, so type it in with double quotations, i.e. "b", so our formula
becomes: =SUBSTITUTE(B4, "b",
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 50
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
The SUBSTITUTE will replace the character "b" with "t" and will return the output as "Bot".
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 51
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 52
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
That's it, and now you have successfully learnt how to use the SUBSTITUTE function in
Excel. Let's explore some complicated examples.
The SUBSTITUTE function cannot replace more than one string in a single function. Since
in the above table, we have to replace all the three strings, we need to have three separate
SUBSTITUTE functions in the same cell and get three of them replaced. To achieve this,
the best method is to nest ONE SUBSTITUTE function inside other.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 53
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
We will type our SUBSTITUTE formula in this column and place the SUBSTITUTE data for
different text values.
o Put your cursor to the second row and start the nested formula by typing: =
SUBSTITUTE(
o Since have three strings that we want to replace therefore we will nest three
SUBSTITUTE functions one inside another. The formula will
be: =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(
o Firstly we will enter the parameter for the third SUBSTITUTE function. We
will replace the string "Boy" with string "M". The formula will become:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C4,"Boy","M")
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 54
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
o Next, we will enter the parameters for the second SUBSTITUTE function. We
will replace the old string "Rahul" with the new string "Rahul Panda". In the
second nested function, you don't require to put the text parameter again;
we will only specify the Old_Text and New_Text arguments. The formula will
become: =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C4,"Boy","M"),"Rahul","
Rahul Panda"),
o For the third nested function, add the parameters. We will replace the old
string "E001" with the new string "EMP001". In the third nested function,
you don't need to put the text parameter again; we will only specify the
Old_Text and New_Text arguments. The formula will become:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C4,"Boy","M"),"Rahul","Rahul
Panda"),"E001","EMP001")
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 55
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 56
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
It will replace all the Old_Text with the New_Text and give you the result.
The nested SUBSTITUTE functions will replace all the old strings with the new strings and
will return the output for all the rows.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 57
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
To replace the line breaks from the text, you can use a combination of SUBSTITUTE and
CHAR functions. To remove the line breaks from your cells follow the below-given steps:
In this column we will type our SUBSTITUTE formula and place the SUBSTITUTE data for
different text values.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 58
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
o In the text parameter, we will specify the string from which we want to
remove the line breaks. It is the reference cell of the string, i.e. B2, so our
formula becomes: =SUBSTITUTE(B4,
o In the second parameter (Old_text) we will specify the line break as that is
what we want to substitute. We know that the ASCII character set is CHAR(10)
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 59
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
o In the third parameter we will specify the new text with which we want to
replace the old text which in our case is comma (,), so our formula becomes:
=SUBSTITUTE(B5,CHAR(10, ",")),", ")
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 60
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 61
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
o Place your mouse cursor on the formula cell and point the cursor to the right
corner of the cell. To your surprise, the mouse pointer will turn into a '+'
icon.
o Drag the '+' icon down the cells. It will copy the SUBSTITUE function to all
your cells changing the cell reference as respective to the cell.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 62
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
IF
Judging by the number of IF-related comments on our blog, it's the most popular function in Excel. In simple terms, you use an
IF formula to ask Excel to test a certain condition and return one value or perform one calculation if the condition is met, and another
value or calculation if the condition is not met:
IF(logical_test, [value_if_true], [value_if_false])
For example, the following IF statement checks if the order is completed (i.e. there is a value in column C) or not. To test if a cell
is not blank, you use the "not equal to" operator ( <>) in combination with an empty string (""). As the result, if cell C2 is not
empty, the formula returns "Yes", otherwise "No":
=IF(C2<>"", "Yes", "No")
Useful resources:
Excel LEN formulas to count characters in a cell
Count the number of characters in cells and ranges
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 63
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
AND & OR
These are the two most popular logical functions to check multiple criteria. The difference is how they do this:
AND returns TRUE if all conditions are met, FALSE otherwise.
OR returns TRUE if any condition is met, FALSE otherwise.
While rarely used on their own, these functions come in very handy as part of bigger formulas.
For example, to check the test results in columns B and C and return "Pass" if both are greater than 60, "Fail" otherwise, use the
following IF formula with an embedded AND statement:
=IF(AND(B2>60, B2>60), "Pass", "Fail")
If it's sufficient to have just one test score greater than 60 (either test 1 or test 2), embed the OR statement:
=IF(OR(B2>60, B2>60), "Pass", "Fail")
CONCATENATE
In case you want to take values from two or more cells and combine them into one cell, use the concatenate operator (&) or the
CONCATENATE function:
CONCATENATE(text1, [text2], …)
For example, to combine the values from cells A2 and B2, just enter the following formula in a different cell:
=CONCATENATE(A2, B2)
To separate the combined values with a space, type the space character (" ") in the arguments list:
=CONCATENATE(A2, " ", B2)
Useful resources:
How to concatenate in Excel - formula examples to combine text strings, cells and columns.
CONCAT function - newer and improved function to combine the contents of multiple cells into one cell.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 64
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
The beauty of these functions is that they don't require any arguments at all, you type the formulas exactly as written above.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 65
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Note. After copying the formula, make sure that all cell references are correct. Cell references may change depending on whether
they are absolute (do not change) or relative (change).
For the detailed step-by-step instructions, please see How to copy formulas in Excel.
VLOOKUP Function
The VLOOKUP function is a premade function in Excel, which allows searches
across columns.
Note: The column which holds the data used to lookup must always be to the left.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 66
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Note: The different parts of the function are separated by a symbol, like comma , or
semicolon ;
Col_index_num: The data which is being looked up. The input is the number of
the column, counted from the left:
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 67
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Use the VLOOKUP function to find the Pokemon names based on their ID#:
H4 is where the search result is displayed. In this case, the Pokemons names based
on their ID#.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 68
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
H3 selected as lookup_value. This is the cell where the search query is entered.
In this case the Pokemons ID#.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 69
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 70
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Ok, so next - 1 (True) is entered as range_lookup. This is because the most left
column has numbers only. If it was text, 0 (False) would have been used.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 71
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Have a look at that! The VLOOKUP function has successfully found the
Pokemon Squirtle which has the ID# 7.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 72
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
It still works! The function returned Charmanders name, which has 4 as its
ID#. That's great.
SUMIF Function
The SUMIF function is a premade function in Excel, which calculates the sum of
values in a range based on a true or false condition.
It is typed =SUMIF:
The [sum_range] is the range where the function calculates the sum.
If not specified, the function calculates the sum of the same range as the condition.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 73
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Note: The different parts of the function are separated by a symbol, like comma , or
semicolon ;
Copy Values
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 74
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
The function now sums the Total stats for Grass type Pokemon.
The function can be repeated for the other Pokemon types to compare them:
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 75
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Now, we can see the sum of total stats for the different types of Pokemon:
SUMIFS Function
The SUMIFS function is a premade function in Excel, which calculates the sum of
a range based on one or more true or false condition.
It is typed =SUMIFS:
The conditions are referred to as criteria1, criteria2, and so on, which can
check things like:
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 76
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
The criteria_range1, criteria_range2, and so on, are the ranges where the
function check for the conditions.
The [sum_range] is the range where the function calculates the sum.
Note: The different parts of the function are separated by a symbol, like comma , or
semicolon ;
Note: The full dataset continues after row 14, all the way down to row 759.
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 77
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
1. Specify the range for the sum C2:C759 (the Total values)
2. Type ,
3. Specify the range for the first conditionB2:B759 (the Type 1 values)
4. Type ,
5. Specify the criteria (the cell F3, which has the value "Water")
6. Type ,
7. Specify the range for the second conditionD2:D759 (the Generation values)
8. Type ,
9. Specify the criteria (the cell G3, which has the value "1")
10. Hit enter
Note: You can add more conditions by repeating steps 9-12 before hitting enter.
The function now calculates the sum of total stats for the 1st Generation Water
type Pokemon.
The function can be repeated for the following Generations to compare them:
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 78
B. Tech - Ist year Department of Information Technology Subject- Computer Fundamantal
Note: You can use the filling function for the other rows, but make sure to use absolute
references for the ranges.
Now, we can see the sum of total stats of Water type Pokemon between
generations:
Notes Complied By- Dr. Mrs. Radha Pimpale, Asst. Prof, PBCOE , Nagpur 79