Formulas in Excel
Formulas in Excel
Choose a cell.
Enter the address of a cell in the selected cell or select a cell from
the list.
Press Enter.
There is another term that is very familiar to Excel formulas, and that is
"function". The two words, "formulas" and "functions" are sometimes
interchangeable. They are closely related, but yet different. A formula
begins with an equal sign. Meanwhile, functions are used to perform
complex calculations that cannot be done manually. Functions in excel
have names that reflect their intended use.
The example below shows how we have used the multiplication formula
manually with the ‘*’ operator.
Excel formulas and functions help you perform your tasks efficiently, and
it's time-saving. Let's proceed and learn the different types of functions
available in Excel and use
core topics and important concepts to help you get started the right way!
There are plenty of Excel formulas and functions depending on what kind
of operation you want to perform on the dataset. We will look into the
formulas and functions on mathematical operations, character-text
functions, data and time, sumif-countif, and few lookup functions.
Let’s now look at the top 25 Excel formulas you must know. In this article,
we have categorized 25 Excel formulas based on their operations. Let’s
start with the first Excel formula on our list.
1. SUM
The SUM() function, as the name suggests, gives the total of the selected
range of cell values. It performs the mathematical operation which is
addition. Here’s an example of it below:
Sum "=SUM(C2:C4)"
As you can see above, to find the total amount of sales for every unit, we
had to simply type in the function “=SUM(C2:C4)”. This automatically
adds up 300, 385, and 480. The result is stored in C5.
2. AVERAGE
3. COUNT
The function COUNT() counts the total number of cells in a range that
contains a number. It does not include the cell, which is blank, and the
ones that hold data in any other format apart from numeric.
COUNT =COUNT(C1:C4)
As seen above, here, we are counting from C1 to C4, ideally four cells. But
since the COUNT function takes only the cells with numerical values into
consideration, the answer is 3 as the cell containing “Total Sales” is
omitted here.
If you are required to count all the cells with numerical values, text, and
any other data format, you must use the function ‘COUNTA()’. However,
COUNTA() does not count any blank cells.
4. SUBTOTAL
Moving ahead, let’s now understand how the subtotal function works. The
SUBTOTAL() function returns the subtotal in a database. Depending on
what you want, you can select either average, count, sum, min, max, min,
and others. Let’s have a look at two such examples.
MODULUS =MOD(A2,3)
6. POWER
7. CEILING
8. FLOOR
Contrary to the Ceiling function, the floor function rounds a number down
to the nearest multiple of significance.
Fig: Floor function in Excel
9. CONCATENATE
This function merges or joins several text strings into one text string.
Given below are the different ways to perform this function.
"=CONCATENATE(A27&" "&B27)"
Fig: Concatenate function in Excel
10. LEN
The function LEN() returns the total number of characters in a string. So, it
will count the overall characters, including spaces and special characters.
Given below is an example of the Len function.
Let’s now move onto the next Excel function on our list of this article.
11. REPLACE
As the name suggests, the REPLACE() function works on replacing the part
of a text string with a different text string.
The syntax is “=REPLACE(old_text, start_num, num_chars, new_text)”.
Here, start_num refers to the index position you want to start replacing
the characters with. Next, num_chars indicate the number of characters
you want to replace.
REPLACE =REPLACE(A15,1,1,"B")
“=REPLACE(A16,1,1, "A2")”
“=REPLACE(A17,1,2, "Sa")”
Fig: Replace function in Excel
12. SUBSTITUTE
The SUBSTITUTE() function replaces the existing text with a new text in a
text string.
Now, we are replacing both the 2010s in the original text with
2016 by typing “=SUBSTITUTE(A22,2010,2016)”.
That was all about the substitute function, let’s now move on to our next
function.
The LEFT() function gives the number of characters from the start of a text
string. Meanwhile, the MID() function returns the characters from the
middle of a text string, given a starting position and length. Finally, the
right() function returns the number of characters from the end of a text
string.
Now, let us hop on to exploring some date and time functions in Excel.
15. NOW()
The NOW() function in Excel gives the current system date and time.
The result of the NOW() function will change based on your system date
and time.
16. TODAY()
The function DAY() is used to return the day of the month. It will be a
number between 1 to 31. 1 is the first day of the month, 31 is the last day
of the month.
The MONTH() function returns the month, a number from 1 to 12, where 1
is January and 12 is December.
Fig: Month function in Excel
The YEAR() function, as the name suggests, returns the year from a date
value.
17. TIME()
The HOUR() function generates the hour from a time value as a number
from 0 to 23. Here, 0 means 12 AM and 23 is 11 PM.
The function MINUTE(), returns the minute from a time value as a number
from 0 to 59.
Fig: Minute function in Excel
The SECOND() function returns the second from a time value as a number
from 0 to 59.
19. DATEDIF
Now, let’s skin through a few critical advanced functions in Excel that are
popularly used to analyze data and create reports.
20. VLOOKUP
Next up in this article is the VLOOKUP() function. This stands for the
vertical lookup that is responsible for looking for a particular value in the
leftmost column of a table. It then returns a value in the same row from a
column you specify.
Below are the arguments for the VLOOKUP function:
lookup_value - This is the value that you have to look for in the first
column of a table.
table - This indicates the table from which the value is retrieved.
We will use the below table to learn how the VLOOKUP function works.
If you wanted to find the department to which Stuart belongs, you could
use the VLOOKUP function as shown below:
Here, A11 cell has the lookup value, A2: E7 is the table array, 3 is the
column index number with information about departments, and 0 is the
range lookup.
If you hit enter, it will return “Marketing”, indicating that Stuart is from the
marketing department.
21. HLOOKUP
table - This is the table from which you have to retrieve data.
Given the below table, let’s see how you can find the city of Jenson using
HLOOKUP.
Fig: Hlookup function in Excel
Here, H23 has the lookup value, i.e., Jenson, G1:M5 is the table array, 4 is
the row index number, 0 is for an approximate match.
Our Data Analyst Master's Program will help you learn analytics tools and
techniques to become a Data Analyst expert! It's the pefect course for you
to jumpstart your career. Enroll now!
22. IF Formula
The IF() function checks a given condition and returns a particular value if
it is TRUE. It will return another value if the condition is FALSE.
23. INDEX-MATCH
Using the below table, let’s see how you can find the city where Jenson
resides.
Fig: Index-Match function in Excel
24. COUNTIF
The function COUNTIF() is used to count the total number of cells within a
range that meet the given condition.
The COUNTIFS function counts the number of cells specified by a given set
of conditions.
If you want to count the number of days in which the cases in India have
been greater than 100. Here is how you can use the COUNTIFS function.
25. SUMIF
Below is the coronavirus dataset using which we will find the total number
of cases in India till 3rd Jun 2020. (Our dataset has information from 31st
Dec 2020 to 3rd Jun 2020).
Fig: Sumif function in Excel
The SUMIFS() function adds the cells specified by a given set of conditions
or criteria.
Let’s find the total cases in France on those days when the deaths have
been less
Example
In this example, we aim to find what will be the rate of interest if the
person wants to pay
PMT function is used when you want to calculate the monthly payment
you need to pay to settle the loan amount.
Let’s go through this problem in steps to see how we can calculate the
interest rate that will settle a loan of $400,000 by $5,000 a month
payment.
Click OK. You will see the goal seek function automatically gives
the interest rate that is required to pay the loan amount.
What-If Analysis is the method of changing the values to try out different
scenarios for formulas in Advanced excel.
Solver works with decision variables which are a group of cells used in
computing the formulas in the objective and constraint cells. The solver
adjusts the value of decision variable cells to work on the limits on
constraint cells. This process aids in determining the desired result for the
objective cell.
In this example, we will try to find the solution for a simple optimization
problem.
Problem: Suppose you are the business owner and you want your income
to be $8000.
Goal: Calculate the units to be sold and price per unit to achieve the
target.
On the Data tab, in the Analysis group, click the Solver button.
In the set objective, select the income cell and set its value to
$8000.
To Change the variable cell, select the C5, C6, and C10 cells.
Click Solve.
28. If-Else
IF function is used to test the condition and return a value if the condition
is indeed true and a predetermined different value if it turns out to be
false.
By using the IFERROR function, you can add a message if the formula
evaluates to an error.
The MATCH function returns the position of the ID you are looking for. The
INDEX function will return the value of the salary corresponding to the
position.