—
Menu
—
Home » Top 101 Excel Formulas
Top 101 Excel Formulas
slo}
EXCEL
FORMULAS
This guide provides an overview of Excel Formulas and functions from the ground up.
Learn the basics through useful examples.
We divided the article into multiple sections. All sections explain
the basic formulas. Furthermore, you can find more advanced
examples. Before taking a deep dive, here are a few must-have articles
about named ranges and logical operators.
Microsoft Excel formulas help you to count, analyze, filter, convert, summarize and
transform data to boost productivity and speed up your work.
Table of contents:—
—
* COUNT
* SUM
* AVERAGE
°F
* MIN and MAX
© DATE and TIME
© TEXT
* LOOKUP
© FILTER
* RANK
* ROUND
Formulas and Functions
There are two ways to perform calculations in Excel; using Formulas and Functions. But
first, it’s time to clarify their differences,
What is a Formula? Excel Formulas are math statements that can
perform calculations and manipulate the values of other cells. Also,
it can test conditions and frequently uses logical operators.
Let's see a simple example:
cell B1 and cell B4.
1 + B2 + B3 + B4 finds the sum of the cell values between
What is a function? Functions are built-in presets, so there are hard-
coded Excel formulas. With its help, you can avoid manual data entry,
and it has small, user-friendly names.101 Excel Formulas and Functions
For Excel newbies, we have a piece of good news. First, please read our article about the
basics. We provide an easy-to-understand overview. Then, start your adventure!
COUNT
The COUNT function counts the total number of cells in a range that contains numbers. In
the example below, you want to count the numbers of cells in the range B2:B6.
2 ~ fe =COUNT(B2:85)
4 A 8 c D elfele
1
2 $
eer * 2 count the total number of cells in a range
4 |Product 8 $ 24
5 |Product 9 $ 163
6 Product 10 $ 136
7 EXCELKID.COM
8
Use the following formula:
=COUNT(B2:B6)
Let us see how to apply the COUNT formula in various situations.
COUNT Formulas
The main goal of count functions in Excel is to count cells and values. In addition, you can
use multiple criteria to create advanced calculations.
Count cells that are greater than or less than a specific value
Count cells between two numbers
Count blank or non-blank cells in a range
Count cells that contain textCount cells that are greater than or cells less than a value
n ¥ fe =COuNTF(82:08,59")
nN B é
Use >= for greater than or equal to
Use <= for less than or equal to
Gann eus
8 EXCELKID.COM
To count the number of cells where the values are greater than a given number, you can
use the COUNTIF function.
The function uses two arguments: range and criteria; the generic formula is:
=COUNTIF(range, criteria)
You can use a named range instead of using B2:88 cell references. In the example, the
range B2:B8 represents a range of cells that contain numbers. Criteria represent the
number value (in cell F2) above which you want to count.
You can find more examples here.
Count cells between two numbers
Sometimes we need to use more than one criteria. In this case, the COUNTIF function can
help count the number of cells between upper and lower limitsEi 3]
Count cells between two numbers
1
3
1
Jennifer 2
4
6
5
EXCELKID.COM
Here is the general formula:
=COUNTIFS(criteria_range, criterial, criteria_range2, criteriaz2...)
The criteria_range represents a range of cells that contain numbers. In the example, cell E6
has the lower limit, and we will use the value in cell £2 as an upper limit of the numbers
you want to count.
In the example, use the formula in E4:
=COUNTIFS (82:8, ">"&E1,B2:B8,"<"&E2)
Count blank or non-blank cells in a range
Fe v fe ~COUNTALANK(e2:28)
4 A 8 c D E E G
s) Count cells that are blanks / non-blanks
mae
‘OUNTBLANK(B2:88)
9 'EXCELKID.COM
Use the COUNTBLANK function to count the number of blank cells in a range.“OUNTBLANK (82: B8)
We have only two empty cells in the range B2:B8, so the COUNTBLANK formula returns 2.
If you want to count cells that are not blank in a range, use the COUNTA function. in
the example, the formula in cell F5 gets the number of non-blank cells.
=COUNTA(BS:B9)
After evaluating the formula, the result is that the range contains five non-blank cells.
Count cells that contain text
5 fe -counnr(cscaue)
ea 2 [ie | os Je iB 6 4 |
: Count cells that contain text
3 Michael TRUE 3
4 11/12/2023 FALSE 4
5| 125 FALSE
6 FALSE
x Chris TRUE
a| #N/A FALSE
9 lisa TRUE
EXCELKID.COM
In the example, you want to count only these cells that contain text values. Therefore, the
generic formula combines the COUNTIF function with the ISTEXT function.
Create a new column and apply the following formula in cell C3:
=ISTEXT(C3:C9)Enter the formula in cell F3:
=COUNTIF (C3:C9, TRUE)
The formula uses the COUNTIF function and counts the number of cells in a range that
match the criteria. In the example, we have three cells that contain text values.
To count the non-blank cells in a range, use FALSE as the second argument.
=COUNTIF(C3:C9, FALSE)
Count cells that contain even or odd numbers
8 . fe =SumPROUCT(-(MOD|numbers.2}=))
al 8 [«¢ | > F e{[ul[ie
1
?), Count cells that contain
3 19 Odd numbers 5| odd / even numbers
4 25 Even numbers 1
5 | a1
6 10
z 9
| " EXCELRID.COM
®
You can combine the SUMPRODUCT function with the MOD function to count cells that
contain odd or even numbers.
The formula in cell E3:
=SUMPRODUCT (- - (MOD (numbers ,2)=1))
This formula returns 5 because there are five odd numbers in the range B3:B8.—
—
Nop(numbers,2)=1
This part of the formula gets the remainder value after division by 2. The MOD function
will return a remainder of 1 for odd numbers and gets 0 for even numbers.
Count items in a group with a percentage breakdown
e ¥ fe =COUNTIF (risk 3)/COUNTAsk)
A 8 c po | « | - (ie Hojo | 3
1
2)
3| High 8/11/2022 High 2 18%
4] Mid 8/11/2022 Mid 2 21%
5| low 8/11/2022 low 6 55%
6) Low ey12/2022
71 Mid 8/12/2022 Percentage breakdown by risk level
@| High 8/13/2022
2) low 9/13/2022
10} Low 8/14/2022
vi] Low ey14/2022
12) Mid 8/15/2022
13/ Low 9/15/2022
In the example, we will use the COUNTIF and COUNTA functions in one formula to create
a percentage breakdown by risk level. The goal is to split the different risk levels into three
categories.
Risk is a named range that refers to B3:B13. We use a simple COUNTIF formula in cell F3,
to count the number of incidents.
=COUNTIF(risk, E3)
Copy the formula down, and it will return the count of each risk level. Now, take a lool
the formula in G3:The left part splits the risk levels into three categories, and the right part of the formula
counts all cells in a range using the COUNTA function. You have only one thing left: apply
the percentage number format in column G.
More COUNT-based examples:
Count cells that contain more than n characters
* Count unique and distinct values
* Count cells that contain numbers
SUM
SUM is the most used, must-have function in some basic Excel formulas. For example, this
formula below summarizes values from a selection of columns or rows that contain
numbers.
es ¥ fe | =suMja3:83)
ala 8 c E - @ [4 mia
1
2)
3 422
4 234
5 q71
6 185,
7 239
a 524 ——
9 | 564 EXCELKID.COM
10 ————
SUM Formulas
Here is a list of some useful Excel formulas based on sum:
‘Sum values if greater than (or less than): SUMIF
Sum values between two numbers: SUMIFS
Sum top n values in a range: SUMPRODUCT, LARGE
Sum every nth row: SUMPRODUCT, MOD, ROW—
—
gure ver varie yrouter unurrun tess un
A - fe -SuMir(sates, 51200")
8 c D E F es ju
|
i]
1,854 Sales > $1200| $ 10,975
1,433 Sales < $1400 $ 5,652
1,102
1,673
127
1,039
1,053
TANT
1,436
1290 ‘EXCELKID.COM
1,180 =
SUM if greater than / less than
You can use the SUMIF function to sum cells greater than a given value. In this example,
we want to sum values greater than $1200.
Apply the formula in cell F3:
=SUMIF(sales,">1200")
Good to know that the formula supports all logical operators as criteria. If you want to find
and sum values where the sales are less than $1400, simply apply the "<$1400" as the
criteria.
Don't forget to use the double-quote before and after the criteria,
or else you will get an error.
=SUMIF (sales, "<1400")A B c D E j oF 6 |
1
2
3] 10-007 $1854 Sales > $1200 AND < $1400
4 | 1D-002 $1433
5) 1D-003 $1,102
©] 10-004 $1673 $ 3,560
7 | 1D-005 $1278 1
3| 10-006 $1,039 SUM if between using SUMIFS
9 | 10-007 $ 1,053
1o| 10-008 $1,399
11| 1D-009 $ 1,436
12] 10-010 $ 1,890 Ree
13| 1D-011 $ 1,180 Eo
Ifyou want to sum cell values between two numbers (criteria), SUMIF can help.
The formula in cell E6:
=SUMIFS(sales, sales,">1200", sales,"<1400")
The formula uses a named range, “sales” for cells C3:€13, and sums all cell values in
column C if the numbers are greater than 1200 and less than 1400.
The “between” criteri a special relationship. It contains the AND logical operator. In
the example, we find the values in column C, which is matching to all of our criteria:
* Criteria 1 = sales, “> 1200"
© Criteria 2 = sales, "<1400"
The sum range is the range C3:C13. The formula uses these criteria and sums all sales
greater than 1200 and less than 1400.
Sum Top n values in a range92 Sum of top 3 values 249)
" Sum of top 7 values a8
Sum Top n values in a range
XCI
m
mh
KID.COM
= |e]
m
g
Use a formula that combines the SUMPRODUCT and LARGE functions to sum the top N
values in a range.
To get the nth value in a range, use the formula below:
SLARGE(range, n)
In the formula, “sales” (the first argument) is a range of cells that contain numeric
values, and N represents the nth value. But we need the sum of the top n values, not the
nth value.
We can use the second argument as an array. Then, instead of a single number value, the
LARGE function will return an array.
The formula finds the 1st, 2nd, and 3rd largest value in the sales range:
=LARGE(sales, {1,2,3}
In the example, the array contains the following values: (92,84,73). Finally, SUMPRODUCT
sums all numbers in the result array and returns 249.
=SUMPRODUCT (LARGE(sales,{1,2,3}))A v fe | -SuMPRODUCT|—(MOD|ROW{erum-ROWES)+,£3}0} values)
2 je |o E s nw | s k
a
1 58 ail Sum every nth row
2 10 44
3 28 5 128
4 2
5 96
6 16
i 16
a 2
9 49
10 32
" 13
12 70 EXCELKID.COM
To sum up every nth row, you can use a formula with SUMPRODUCT, MOD, and ROW
functions.
=SUMPRODUCT ( - - (MOD(ROW(rnum) -ROW(B3)+1,£3)=@), values)
We use a named range, "enum which refers to range B3:B14.
Take a look inside the formula. The ROW function gets a set of row numbers for the
range, which looks like this: (1,2,3,4,5,6,7,8,9,10,11,12}
After that, the MOD function returns the remainder for each row number divided by N.
Use a double-negative (-) to convert TRUE and FALSE to ones and
zeros. The output array looks like the following: {0,1,0,1,0,1,0,1,0,1,0,1)
For example, if N=2, the MOD function will return the array below:EXCELKID.COM
Where the value equals 1, SUMPRODUCT multiplies and then sums the arrays’ values. In
the example, the total for every second row is:
=(10 + 22 + 16 + 22 +32 + 70) = 172
This method works fine when you want to sum every nth column; you need to replace
the ROW function with COLUMN.
Sum if a date is greater than—
=
2| Eee 53263]
#010011
3 8
4 #01002 16-Aug-2022 $ 1,909 SUM if date greater than
5 | #01003 17-Aug-2022 $ 2,883
6 #01004 18-Aug-2022 $ 2,567
7 #01005 19-Aug-2022 $3,405,
a #01006 20-Aug-2022 $3,046
8 #01007 21-Aug-2022 $ 2,925
10| #01008 22-Aug-2022 $ 2,006
1 #01009 23-Aug-2022 $ 2,023
fe #01010 24-Aug-2022 $ 2,092
13 #01011 25-Aug-2022 $ 1,815
14 #01012 26-Aug-2022 $ 3,002 EXCELKID.COM
SUMIF function gets the answer if you want to sum sales for a given period. In the
example, you want to add a date and find dates greater than the start date.
The formula in cell G2:
=SUMIF (date, ">"&DATE(2022,8,20), sales)
In the formula, "date" and “sales” are named ranges and sum the sales in column D when
the date in column C is greater than Aug 20, 2022.
Good to know that you can use other logical operators (equal to, greater than or equal to,
less than, etc.) So, you can change the criteria easily.
We are using Excel's DATE function. With its help, it is easy to split dates into separate
values. Add an ampersand to join the logical operator to date (&).
Additional resources:
formulasFormula example:
=AVERAGE(B3:88) shows a simple average of six numbers in a range.
2 ¥ fe =AVERAGE(B3:68)
8 c | > E Pn cn
=a 2.616
3
3,046 EXCELKID.COM
Tip: the AVERAGE function ignores logical values, empty cells, and cells that contain any
text.
Average formulas
The following examples will explain how to use various Excel formulas with AVERAGE to
calculate top or bottom scores and values in a given range.
* Average of top 5 scores: AVERAGE, LARGE
* Calculate the average of the last 3 values: AVERAGE, OFFSET, COUNT
* Average sales between Monday and Friday: AVERAGEIFS
Average of top 5 scoresfey 3 10 62 CUCU 7
fom 9 2 10 4 «(1010 75 86
9 1 4 9 0 7 67 78
8 5 8 7 1 «9 63 74
-| Caleulate each group's average of the top 5 scores
tole |S lo lols [ily
EXCELKID.COM
Combine the AVERAGE and LARGE functions to calculate each group's average of the top
5 scores.
In the example above, enter the following formula in cell K3, then copy it down:
AVERAGE (LARGE (C3:H3,{1,2,3,4,5}))
The LARGE(C3:H3,1) formula returns the highest value in a given range. Using the
same logic, LARGE(C3:H3) returns the second largest value, and so on.
Our example will use an array constant (1, 2, 3, 4, 5) as a second argument of the LARGE
function. The retuned array will include the highest five values.
In cell K3, LARGE(C3:H3, {1,2,3,4,5)) returns the following array:
{10, 8, 7, 4, 3}
The AVERAGE function will use the return array as an argument and gets the average of
the highest five values:
=AVERAGE({10, 8, 7, 4, 3} = 6.4
Calculate the average of the last 3 value2, D tz
3 | July 18,2022 94 26
4] July 19, 2022 92
5} July 20, 2022 99 Average of last 5 values
6) duly 21, 2022 95
7 | july 22, 2022 96
8) July 23,2022 99
8) duly 24,2022 99
10| July 25, 2022 ”
vi] July 26, 2022 98 EXCELK!
a aa eee
In the next example, we want to calculate the average of the last three values in a range.
To do that, we will use three functions in a single formula.
The formula below uses the AVERAGE, COUNT, and OFFSET functions:
=AVERAGE (OFFSET (C2, COUNT(C2:C11) ,@,-3))
We have nine numeric values in column C. Using these values; First, OFFSET will use the
C2 cell as a starting point and offsets nine rows until the end of the range, C11. After that,
steps three cells up to create the starting point of the new range, cell C9.
Finally, OFFSET returns the range C9:C11 to the AVERAGE function, which calculates the
average of values in that range.
Average sales between Monday and Friday2
3 7/4/2022 1$ 1578
eS iste 2 isla Average sales on working days
5 7/11/2022 1$ 4587
6) 72/2022 2 $ 2400
7 7/13/2022 3 $ 1,900
a] 76/2022 6 $ 1,800
9) 7/7/2022 7 $ 1533 EXCELKID.COM
1
We will use two criteria in the example to calculate the average sales on working days,
from Monday to Friday. The AVERAGEIFS function can handle multiple criteria, the
formula in cell Ad:
=AVERAGEIFS (amount, days, ">=1",days,"<=5")
The formula uses two named ranges:
* amount = D3:D9
© days = C3:C9
First, create a helper column in column C, For example, the WEEKDAY function helps you
extract an integer value from a date. The question is how to identify if the date is a
working day.
The formula in cell C3:
=WEEKDAY(B3,11)
Configure the second argument (return_type) and use 11 as an output format. Using this
method, Monday will be 1, Tuesday returns with 2, and so on.
In the example, the AVERAGEIFS formula will use two criteria to calculate the average salac
on working days:Finally, we have the proper criteria; you can build the final formula:
=AVERAGEIFS (amount, days, ">=1",days,"<=5")
The average sales are $1755 on the working days.
IF
The IF function has superb usability in Microsoft Excel, After the basic example, we will
show you more advanced examples.
IF Formulas
* Basic IF example
Extract name If the cell contains a partial match: IF, ISNUMBER
‘Nested IF function example: IFS
* IF function and logical operators (multiple criteria): AND, OR
© Check if a cell is not blank
Basic IF formula example
The IF function runs a logical test and returns the TRUE (=1) or FALSE (=0) output.
my fe
4A 8 c_ |p E FoG¢ | J
1
2 | EEE [Result |
3 | 65 45 ‘(B3>C3, TRUEFALSE) TRUE
4 (B3>C3,"B3 > C2","C3> B37) 83> C3
= =IF(B3>C3,B3,C3) 65
6 ————
z EXCELKID.COM
a
The formula in cell G3:checks if the value at B3 is greater than the value in cell C3. If the logic is true, the
result is 1. If not, 0.
Use a description to make the formula easy to readable: =IF(B4>C4, "B3 > C3", "C3 < B3"),
Because the B3>C3, the formula returns with the text: “B3 > C3”. To write the greater value
in a cell, use the formula:
=IF(B3>C3, B3, C3)
In this case, the result is 65 in cell E6.
Extract name If the cell contains a partial match
a - (fe ~F{ISNUMIBER|SEARCH|"excetkid",23),83,%)
8 f € E F cs [4
Extract name if the cell
[email protected] [email protected] contains a partial mateh
[email protected]
[email protected]
[email protected]
[email protected] [email protected]
[email protected] EXCELKID.COM
The following formula example will show how to use the IF, SEARCH, and ISNUMBERS
functions together to extract a name if the cell contains a partial match.
The IF function provides versatile formula, but it has no wildcard support. So, if you want
to use it for testing text values, we need to append the formula with the SEARCH and
ISNUMBER functions,
To extract names that contain “excelkid”, apply the formula in cell C3:
=IF (ISNUMBER (SEARCH(""excelkid" ,B5)),85,"")If no partial match is found, we “create” a blank cell, using “” as the last argument.
Nested IF function example using IFS
ps v (fe | =IF5(C300,*No Bonus", C3<10000,"C1" C12000,"C2",C3<=13000, C3",C3>13000,"C4")
8 c D E F os | oH 1
MICHAEL 3 $ 8,000 No bonus
DAVID $ A $ 10000 C1
JOHN $ a 1esiflawstions $ 12,000 c
JENNIFER = S 3 $ 13000
CHRIS $ a with multiple ¢13,000+ C4
JESSICA s a criteria
usa s 2
MIKE 8 No Bonus
ANTHONY $ a
JAMES s ca EXCELKID.COM
You can use the IFS function with multiple criteria instead of multiple (nested) IF
functions. IFS checks all criteria and returns the first result where the test is TRUE.
The big advantage is that the IFS-based formula is shorter, providing better readability. In
the example above, we create categories (bands) to identify the bonus grade for all sales.
Enter the following formula in D3, then copy it down:
=1FS(C3<8000, "No Bonus” ,C3<10000, "C1" ,C3<1200, "C2" ,C3<=13888, "C3" ,C3>13000, "C4"
‘ »
The formula must test the lowest sales first and get the TRUE if the sales are in the given
category. For example, C3= $12754. The expression will check the criteria in the
following order:
IF(C3<3000) -> FALSE, the test jumps to the next criteria and tests cell C3 again. The fir
matching value (if the test returns with TRUE) is the "C3 bonus category”AB E D F a iu
Name Te
MICHAEL North = ~—12,754|_ Match ny
DAVID South $14,200 ~ i Sales > $1000
JOHN East $ 9032 - AND
JENNIFER West $ 12900 Match Region = West OR North
CHRIS South $9,162 -
JESSICA East $ 13,807 -
USA Noth $10,113 Match
MIKE West $7446 -
ANTHONY South $9,926 -
JAMES West $ 15900 Match EXCELKID.COM
You can use the IF function to test multiple conditions using the common logical operators
(AND, OR).
In the example, enter the formula below in cell E3:
=IF (AND (D3>10000, OR(C
jest" ,C3="North")), "Match", "-")
If the sales are greater than $10000 and the region is either “West” or “North”, the formula
returns “Match”. In other cases, the “-" formula will use a “-" string as an output.
Following the best practice, evaluate the formula from the inside out:
=AND(D3>1008@, OR(C3="West”,C
North")), "Match",
The expression will return TRUE only if the value in cell D3 is greater than $1000 AND the
Region in C3 is either “North” or “West”. When the logical test gets a TRUE result, the IF
formula returns "Match’, Else returns the "=" string,
Check if a cell is not blankDe Re a Ed Blank
MICHAEL North $ 12,754 Not blank
ae pan wae Check blank oF non-blank
JOHN East blank cells in a range
JENNIFER West $ 12,900, Not blank
CHRIS. South $ 9,162 Not blank
JESSICA, East $ 13,807 Not blank
USA North blank
MIKE West blank
ANTHONY South blank
JAMES: West $ 15,900, Not blank
As a great replacement for the ISBLANK function, you can use a simple IF formula with
logical criteria if you want to check blank or non-blank cells in a range.
Use the formula in cell E3; it is easy to test the blank cells:
=IF(D3<>"", "Not blank", "blank")
Explanation: If the value in cell D3 is not equal to”, the result is TRUE and returns with a
“Not blank" text string. Therefore, the third (optional) argument of the IF function (values if
false) is “blank”.
MIN and MAX
If you are working with Excel formulas, you definitely will find the minimum or maximum
values in a range. For this purpose, use the MIN and MAX functions. If you have multiple
criteria, use the MINIFS and MAXIFS functions.
MIN and MAX Formulas
* Basic MIN and MAX example
* Using the MINIFS and MAXIFS functions
Find the imum or maximum value in a rangeaia 190 190 968
636 265
968 813 Get the minimum or maximum
373 321 value from a set of numbers
743 288
346 492
713 470
674 396
227 765 |
680 580 EXCELKID.COM
Use the MIN function to find the minimum value in a range. For example, here is the
formula to get the minimum value in the range 83:812.
=MIN(B3:B12)
The MIN function uses multiple arguments. For example, you can use multiple ranges to
find the minimum value. The function skips the text values and empty cells and uses only
values.
Sometimes we need to find the maximum value in a range; in this case, we use the MAX
function. Using the range mentioned above, use the formula below to find the maximum.
value:
=MAX(B3:B12)
MINIFS and MAXIFS functions2 tater
3 14 190 580 _|=MINIFS(B3:C12,B3:C12,">500")
4 636 265 765 =MAXIFS(B3:C12,B3:C12,"<800")
5 | 968 813,
6 373 321 Get the min. value where the value is > SOO
z 743 288 Get the max. value where the value is < 200
a| 346 492
9 713 470
10 ora 396
"1 227 765 —
12 620 580 EXCELKID.COM
13
You can use the MINIFS function to get the minimum value in a range and have one or
more additional criteria.
In the example, we find the minimum value where the values are greater than 500.
=NINIFS(B3:C12,B3:C12,">500")
Use the MAXIFS function to get the maximum value in a range and have one or more
additional criteria
=MAXIFS(B3:C12,B3:C12,"<800")
In the example, we find the maximum value where the values are less than 800.
DATE and TIME
This section will demonstrate the basic and advanced usage of Excel formulas that uses
DATE and TIME functions.
Date and Time Formulas
* Calculate days between two dates
* Calculate the number of days ina month u:
.g: EOMONTHCalculate days between two dates
You can calculate the remaining days between two dates without using any Excel function.
For example, the formula below subtracts the earlier date from the later date.
end_date - start_date
In the example shown, enter in DS the following:
=C5-B5
A 8 c > { F_| 6 _Baeithom
1
2| Eee nc CSS
3| 8/15/2022 9/13/2022 23 1721/2022 31
4] efie/2022 9/18/2022 33 3/11/2022 31
s| 8/17/2022 9/15/2022 29 2/20/2022 28
6| 8/18/2022 9/21/2022 34 4/1/2022 30
7) 8/19/2022 9/17/2022 23 5/18/2022 31
a| 8/20/2022 9/18/2022 29 6/18/2022 30
9) Br2022 9/19/2022 23 7/9/2022 31
ro] 8/22/2022 9/20/2022 23 9/15/2022 30
ai] 8/23/2022 9/21/2022 23 1411/2022 30
12| 8/24/2022 9/22/2022 23 27972022 28
13
4 days = end date - start date =DAY(EOMONTH(F3,0))
Calculate the days in the given month
You can use a custom formula and combine the EOMONTH with the DAY functions to get
the number of days in a selected month.
In the picture above, we have dates in column F. So then, the formula in cell G3 is:
=DAY (EOMONTH(F3,))a
=
rrr are re ign nen HET
The DAY function converts the date serial to a number value and returns the day using a
number format between 28 and 31
Display the current date and time
[a a | z fo | ie eo | «|
1
2| Display the current date and time
3 fODAY() 6/17/2022
4) =NowO 6/17/22 10:08 AM
5 KID.COM
6
Sometimes it can be useful to insert the current date into your Workbook. Use the TODAY
function to return with the current date.
TODAY and TIME functions do not use arguments, and you can enter the formula with
empty parentheses:
=TODAY()
You can use the NOW function if you need to display the current date and time in a
worksheet
=NOW()
Tip: Excel will recalculate the cell at every opening, so if you want to.
keep it static, use a copy and paste it as a value.
Get the age from a birthdate—
2 Tee a
3| ANDREW 12/4/2004 1 Get age From birthdate
4) MICHELLE 18/2001 21
5 | DANIEL 11/15/1955 66
©) MARIA 3/5/1983 39
7 | NICOLE 11/5/1990 31
| ALEX 9/2/1976 45
| MELISSA S/I7/1965 57 EXCELKID.COM
You can extract the age from a birthdate using a formula that uses the TODAY and
DATEDIF functions.
In the example, use the formula below and copy it down:
=DATEDIF (C3, TODAY(),"y")
The result (age) always will be up-to-date because Excel will recalculate the TODAY() parts
of the formula.
DATEDIF is a hidden (you can't find it in Excel's built-in function list) compatibility function
but useful and supports all Excel versions. It is a useful function for calculating the period
between two dates in years, months, and days.
TEXT
Using the above-listed Excel formulas, you can dive deeply into the world of text
transformation, conversion, and extraction.
TEXT Formulas
* Text conversion formulas: UPPER, PROPER, LOWER
* Capitalize the first letter of a string: UPPER, LEFT, MID
* Compare two strings: EXACT
* Count total words in a cell: LEN, TRIM, SUBSTITUTE
* Get the first word from a cell: LEFT, FINDText conversion formulas
us fe
LA 8 [_¢ D e je a H
XJ
2| Sa Text conversion
3 Data is beautiful, =UPPER() DATA IS BEAUTIFUL. formulas
4 =PROPER Data Is Beautiful.
5 | =LOWER data is beautiful. EXCELKID.COM
e —
Excel has more built-in functions for text conversion purposes. For example, the B3 cell
contains the following text in the example: "Data is beautiful”
All functions use a single argument, the cell cont:
transform.
g the string you want to
The UPPER function converts a string to all uppercase letters.
=UPPER(B3)
The PROPER function converts a string to proper case, the first letter in each word to
uppercase, and all other letters to lowercase.
=PROPER(B3)
The LOWER function converts all letters in a text string to lowercase.
=LOWER(B3)
Capitalize the first letter of a string=
= ape
he
3 | datais beautiful Data is beautiful Gapitali-the
4] every child likes an ice cream Every child likes an ice cream first letter
5| the Excel course starts next Sunday |The Excel course starts next Sunday
| catshate water [Cats hate water |
us
= —
3 EXCELKID.COM
Excel does not contain a built-in function to capitalize the first letter of a single word or a
large string. However, you can create a custom formula that uses the LEFT, MID, and
LEN functions.
Enter the following formula in cell C3:
=UPPER(LEFT(83) )&MID(B3,2,LEN(B3))
Evaluate the left part:
=UPPER(LEFT(83))
capitalize the first letter, in the example, “D”
=MID(B3, 2, LEN(B3))
extracts the remaining characters, in the example “ata is beautiful”
We use a simple ampersand to concatenate the two parts of the formula; the result: “Data
is beautiful.”
Compare two stringsE EQUAL
Grapefruit FALSE
tomato FALSE
melon TRUE
Watermelon Watermelon TRUE
EXCELKID.COM
You can use the EXACT function to compare two strings. The function uses a case-
sensitive way and checks the differences between upper and lower characters. In case of a
match, the following formula returns a TRUE or FALSE result.
Enter cell D3:
=EXACT(B3, C3)
In non-case sensitive comparison, simple use the equal logical operator:
=B3=C3
will return TRUE.
Count total words ina cell
a x fe =LEn(TRIM(B3))-LEN(SUBSTITUTE(BS,
AA 8 c D e|e
1
co count the total
2 | Sometimes the simplest things mean the most 7 ‘
words in a cell
4.| Everything happens fora reason 5
5 | To fallis not to fall, you fall what you do not try B
e EXCELKID.COM
of
Here is the generic formula to count the total words in a cell:Explanation: Excel does not have native support to count words. We will use the
SUBSTITUTE, LEN, and TRIM functions to construct a custom formula,
The LEN function counts the total number of characters in the cell with and without
spaces, then uses the difference to figure out the word count.
To simplify the formula, think about it:
Total word count = (count of spaces) +1
The first expression counts all characters in cell B3, then remove the extra spaces.
=LEN(TRIN(B3))
The nested TRIM function removes the first and last spaces and cleans the spaces between
words.
=SUBSTITUTE(83," "," “)
The SUBSTITUTE function replaces all spaces with a zero-length string,
Get the first word from a cell
ao ~ fe -42F103,N0("99)-1)
8 D e | fF
‘Sometimes the simplest things mean the most [Sometimes Get the first word
Everything happens for a reason Everything
To fallis not to fail, you fail what you de not try To CEL RIDICOM
To extract the first word from a cell that contains text, use the generic formula:Explanation: The FIND function gets the position of the first space character in the text.
The LEFT function will use the result (-1) as a num_chars argument and extract all
characters from the beginning until the “text position-1."
If the cell contains a single word, we need to handle errors using the IFERROR function.
The formula works simply: in case of error; the expression returns the original text:
=TFERROR(LEFT(B4,FIND(" ",B4)-1),B4)
Extract the last word from a cell
a ¥ fe =rena(ricim(svestmTuTe|a3,
Ala 8 € D eo F
| Extract the last word
Everything happens for a reason reason
1
2
a
4 | Sometimes the simplest things mean the most most
5
6
7
REPT("*, 300), 200))
To fall is not to fail, you fail what you do not try try ——
EXCELKID.COM
The formula demonstrated above in cell range C3:C9 extracts the last word from an
adjacent cell in column B.
=TRIM(RIGHT(SUBSTITUTE(B3, " ", REPT(" ", 3@8)), 30@))
Look under the hood! For example, if your words are longer than 300 characters, change
each instance to 300. Using the REPT function, repeat the specific text (space) character
300 times,
=REPT(" ", 300)
This snippet will return 300 joined space characters. After that, the SUBSTITUTE functic
replaces each blank in the cell value with 300 blanks.Use the RIGHT function to extract 300 characters from the right.
=RIGHT (SUBSTITUTE(B3," ",REPT(" ",300)), 300)
Finally, remove all leading and trailing spaces using the TRIM function
=TRIM(RIGHT(SUBSTITUTE(B3, “ ", REPT(" “, 3@@)), 30@))
Here is another example that uses the GetLastWord used-defined function.
Combine text using TEXTJOIN
R ¥ fe =THCIOIN(* "TRUE, 83:81)
aa; 8 jc D jel £ 6 4 |
|
2
3| The ignore empty = TRUE [The Sun always shines on tv
4 | Sun ignore_empty = FALSE The Sun always shines on tv
5
6
7 | always
oe Concatenate values using a
40] on delimiter (or without it)
nl wv EXCELKID.COM
2
In Excel, concatenating multiple text values is a daily routine. TEXTJOIN concatenates
values using a delimiter (or without it).
Arguments:
* delimiter
* ignore_empty
* text?EXTIOIN(” ", TRUE, B3:811)
will return “The Sun always shines on tv” and ignore the blank cells.
=TEXTIOIN(" “, FALSE, 83:B11)
will return “The Sun always shines on tv" and concatenate the blank cells too.
More examples:
How to convert TEXT to numbers
«Remove the first character from a string
* How to remove multiple characters from a text string
* How to remove text by position
‘* How to split text and numbers
«Split text string at specific character
* How to find if a cell contains a specific text in Excel
«Split text with delimiter
* Extract the nth word from a text string
* How to abbreviate names or words
* Trim text to n words
* Get the first word from some text
‘* How to Split dimensions into two parts
© Get the middle name from a full name
‘+ Remove characters from right
© Remove the file extension from the file name
* Get the first name from a full name
LOOKUP
Excel Formulas may use powerful lookup functions to find the lookup value in an array.
This section will introduce you to the most used methods.
LOOKUP Formulas—
—
err rr rr
* Lookup formula to calculate the nth largest value
INDEX function example
Eo ~ fe =INoex(o810,2-)
dal pb | ic po |e Foi 6 4 ij
1_| Get a value in a section of specified rows and conn
2
a
4 Product 1 . ; 2,026 row=2, column=4
5 2 Product 2 2 $38 (BSA
6 Product 3 3 $ 50 $ 7,930
iz Product 4 4 T$ $5438 3,454
a Product 5 5 $ 6 $ 1467
s| Product 6 6 $ 2 $ 1,032
19 | Product 7 7 $ 6 $ 2,432
un SELKID.COM
R
|
You can use the INDEX function to get a value in a section of specified rows and columns.
In the example, get the second item in the fourth column.
=INDEX(C
10,2,4)
The function uses two required and one optional argument:
* The array is the range or array from which to retrieve values.
© Arow number is a number from which rows get a value.
* The column number is optional at which to retrieve a value.
MATCH function examplespinach garlic a
Return the position of a value
carrots
broccoli in @ range or an array.
garlic
green peas
beets
asparagus EXCELKID.COM
Use the MATCH function to return the position of a value in a range or an array. The
function supports exact matches, approximate matches, and wildcards.
In the example, use the formula below to get the position of the lookup value in the range
3:09:
= MATCH(E3,C3:C9,0)
The formula returns with 4 because the position of “garlic” is 4 in the range C3:C9.
The function uses two required and one optional argument.
* lookup_value is the value that we search in the array
* lookup_array is a range of cells where we find the lookup value
‘+ match_type is an optional argument (exact match or next smallest = 1, exact match
= 0; exact match or next largest = -1)
INDEX and MATCH example= =row 5, column 5,
3 Text Price °
4 Product 1 1 § 63 $2026 MATCH provides row no.
5 Product 2 2 38 $3458
6 Product 3 3 $ 50 $7,930 65)
7 Product 4 4 $ 13 $5,139
a Product 5 5 § 65 $1,487
9 Product 6 6 $ 29 $ 1,832
Product 7 7 $ 63 $2,432
EXCELKID.COM
In the example, we have Product 5 in position 5. Therefore, we use the MATCH function to
find “Product 5” (HS) in row 5 and give the position to INDEX.
The formula in H6 is:
INDEX (C4: F10, MATCH(HS,C4:C1@,0),3)
INDEX will use the MATCH-based formula as the second argument.
Lookup formula to calculate the nth largest value
eo . fe =KLCOKUP(LARGE|soles,£3)sales;name)
4A | B [¢ | o. E | F H 1 1 |
1
2) SC ta
3 ANDREW $2,026 1 $7,930 [DANIEL
4) 3 MICHELE $2,454 2 $5139 MARIA — Calculate the nth
5 | 2 DANIEL $7,930 3 $3,454 MICHELLE largest value
6 | 2 MARIA $5,139
z NICOLE $1,467
a) ALEX $1,832
8 MELISSA $2,432
We love XLOOKUP; the function makes your life easier. For example, you can use it to
return the name of the nth largest value or simply the nth largest value in a range.Sales (C3:C9) and name (B3:B9) are named ranges.
Arguments:
* Lookup value = £3
* Lookup array = LARGE(sales, £3)
* Return array = name
LARGE returns the largest value in a range, $7930. XLOOKUP will use the result as a lookup
value:
=XLOOKUP($7930 ,sales ,name)
You can replace the lookup values to get the name for the 2nd and 3rd largest
amounts.
More examples:
‘+ How to use VLOOKUP to get multiple matches
FILTER
With the help of the FILTER function, you can write smart Excel formulas to filter and
extract data from a range.
FILTER formulas
© Basic FILTER example
* Extract matching records in two lists: FILTER, COUNTIF
* Extract the first N or last N records: INDEX, FILTER, SEQUENCE
Basic FILTER example2) EES von
matching records
3| A100002 ANDREW § 2,026 North
4| A100003 MICHELLE $ 3.454 South Se
S| At00004 DANIEL «$7,930 West [A100002|ANDREW $2,026 North
6} A100005 = MARIA $5,139 North [A100005 MARIA. $5,129 North
7 | A100006 NICOLE $ 1.467 South |A100008 MELISSA $2.432_North
8) A100007 ALEX —$ 1,832 West
@ | A100008 MELISSA § 2,432 North a
10 EXCELKID.COM
1
In the first example, we will show you how to use the FILTER function to find and extract
all matching records.
The formula below extracts all records from a list where the region = “North”.
=FILTER(B3:£9,£3:E9-H2,"not found")
The formula uses a logical test and finds the corresponding item(s) in an array, If FILTER
has a match in the array, return all records. We use the if_not_found argument to handle
errors in case no matching record is found
Extract matching records in two list
a - fe =FLTER(Istz,COUNTF(ist2,5t2))
e | c¢ D|
ET
DANIEL MELISSA DANIEL
MICHELLE LISA MELISSA
MELISSA DANIEL |ANDREW
Compare two lists and
extract the matching
ANDREW ANDREW —_|NICOLE records
NICOLE NICOLE ALEX
ALEX ALEX Lisa,
LISA JOHN
MIKE STEVE
ANTHONY
JAMES EXCELKID.Cia
=
As usual, we are using named ranges for the better readability
© list1 = B3:B12
© list2 = C3:C10
The formula in cell E3:
=FILTER(1ist1, COUNTIF(1ist2,1ist1))
In the example, we find the list2 items in the list. COUNTIF count all records in the list2.
So, the function arguments look like this:
© range = list2
© criteria = list!
The result is an array that contains six matching records, which spill into the range
E3:E8. Try to update your data; the function will recalculate the matching values.
Extract the first N or last N records
va ~ fe =NOEX(FILTER(list 5119") SEQUENCE(S,1,11))
e je D Ee {| ej] ¢@jaje |
DANIEL
MICHELLE
MELISSA
Extract the first or last 5
records
ANDREW
NICOLE
ALEX
LISA,
MIKE
ANTHONY.
JAMES EXCELKID.Ct—
—
Enter the formula in cell D3:
INDEX (FILTER(List1, list1<>"") , SEQUENCE(5,1,1,1))
Evaluate each part of the formula:
The SEQUENCE(5,1,1,1) return an array: (1, 2, 3, 4, 5)
Now filter the non-blank cells:
=FILTER(data, datac>"")
Finally, the INDEX extracts the array’s 1st, 2nd, 3rd, 4th and Sth values.
To extract the last 5 non-blank values, use the formula below:
INDEX(FILTER(data,data<>""), SORT (SEQUENCE (3,1, SUM(--(data<>"")),-1)))
RANK
RANK formulas
* How to rank scores
* Rank values by month
How to rank scoresRank a set of numeric values in
mE —| ar ascending or descending order
MELISSA 59
ANDREW. 14
NICOLE 75
ALEX 43
LSA 81
MIKE 82
ANTHONY 67 —
JAMES v7 EXCELKID.COM
The RANK function is the fastest way to rank a set of numeric values in ascending or
descending order.
In the example, we use a named range, result (C3:C12); the formula in D3 is:
=RANK(C3, result) or =RANK(C3, result,@)
The function uses the third argument to decide the order. If you do not use this optional
argument, the formula gets the values from the highest to the lowest (order = 0). To create
a rank where the lowest value is the first, use the "1" as an argument.
We want to create a rank using the “highest-first” method; it is not necessary to use the
third argument; it is “0” by default.
Rank values by monthDom Don Sales, CT
THOMAS 18-Aug $ 1 [gs 2691]s 2686 $2,505
NICK 11-Aug $2,409 2 $ 24228 2626 $2,401
JUSTIN 1a-Aug $2416 3 $ 2416 $ 2422 $2,400
JOHN 1TAug $2,422
NICK ce EAM Rank |August _\September October
JUSTIN BSep $2,422 1 THOMAS THOMAS — NICK
THOMAS 4Sep $2,686 2 JOHN NICK JUSTIN,
10) NICK 12-Oc $ 2505 3 JUSTIN JUSTIN. THOMAS
JUSTIN 15-Oct $2401
THOMAS 12-Oc $2,400
Rank values by month = EXCEL ID.COM
Now we take a deep dive into an exciting challenge. The goal is to create a ranked list
based on the monthly sales.
First, rank values by month:
=LARGE (IF (TEXT(date, "nmmn")=G82, sales), $F3)
Evaluate the formula: use the TEXT function to convert dates to months using the
“mmmm” format.
The LARGE function returns the nth largest value. For example, cell G3 returns 2691; this is
the first largest value for August. Copy the formula down to fill the table.
To get the list that shows the names, not the values, use the formula below:
INDEX (name, MATCH(1, (amount=G3)*(TEXT (date, "mnmm" )=G$7),))
ROUND
We have many options to build Excel formulas for rounding purposes. In this section, vou
can find various examples that use the ROUND and their related functions.a
=
er
* Round numbers up and down
* Get the integer or decimal part of a number
‘* Round a number to the nearest multiple
* Round time to nearest 10 minutes
Basic ROUND Example
2 v fe -ROUND(2.5,1)
fe t
,OUND(3.35, 1) Rounds 3.35 to one de | place
OUND(9.149, 1) Rounds 9.149 to one decimal place o4
(OUND(-9.275, 2) Rounds -9.275 to two decimal places 9.28
OUNDIA1.5, 1) Rounds 41.5 to one decimal place to the left of the decimal point 40.
Rounds 991.3 to the nearest multiple of 1000 000
Rounds 10.98 to the nearest multiple of 10 10
1) Rounds -101.15 to the nearest multiple of 100 -100
EXCELKID.COM
The ROUND function rounds numbers to N digits, where N is an integer. In the example,
we want to round 3.35 to one decimal place.
The function has two required arguments:
* the number that you want to round.
* num_digits are the number of digits
Formula:
=ROUND(3.35,1)
The result is 3.4.
Round numbers up and down—
—
ound numbers up, awag
3 8.53349 8.5335] Fishy aa.
|
4 8.53349 a 054
5 | 8.53349 1 86
6 8.53349 0 9
i 8.53349 a 10 EXCELKID.COM
8
Use the ROUNDUP function to round a number up, away from zero,
Example:
=ROUNDUP(B3, C3)
Look at cell D4! The formula rounds the value in cell B4 up to 2 digits and returns 8.54.
=ROUNDUP(B4, 2)
The ROUNDDOWN function rounds a number down. For example, if you need to round
the 8.53349 down to 2 digits, use the formula below:
=ROUNDDOWN(B4, C4)
In this case, the result is 8.53.
Get the integer or decimal part of anumberGet the integer or decimal part
3 8.43349] 8 8 8
4 6345, 6 6 6 of a number
5 416 4 4
6 0.51 0 * 0
7) ante nat EXCEIRID.COM
z !
Use the TRUNC function to truncate a decimal part of a number and leave only the integer
part.
Generic formula:
=TRUNC(B3)
TRUNC cuts off the decimal part of the number by default. But it provides a second
argument to control the precision. We want to extract only the integer part in the example,
so use the first argument only.
Ifyou want to extract the decimal part of a number, use the formula below. The formula
subtracts the decimal part of the number and strips the integer part.
=B3-TRUNC(B3)
Round a number to the nearest multiple
2 ¥ fe -MROUNDIE2,3)
y 8 c D e | fie a | |
2|m Ce biipatia. Lamabebacene
3|$ $ 112.00 .
4/$ 1221 500 $ 170.00 nearest multiple
s|$ 1221 o170 $ 112.20
«| $ 1221 100 §$ 112.00 EXCELKID.COM
7—
—
=MROUND(B3, C3)
Explanation: The MROUND(83, C3) round the number in the C3 cell to the nearest
multiple based on the cell value in C3 (2). The result in D3 is $112.00 because $ 112.00 is
the nearest multiple of 2 to 112.21
Round time to nearest 10 minutes
a » fe | =MROUND(83"0:10")
8 a ry e | fF s w | 1 | 3 K
2 L
5 22 PM 7:20 PM Round a time value to the nearest
4 11:02M__11:00 PM 40 minute interval.
s| 5:11AM AM
6 3:24 AM AM ——
7| 12:46PM — 12:50 PM EXCELKID.COM
a
Sometimes we need to create a schedule in Microsoft Excel. In the example, we will use the
MROUND function to round the time to the nearest 10-minute interval.
=MROUND(B3, "@:10")
For example, if you want to apply "0:10" as the multiple, Excel will convert 0:10 to
0.006944. This is the corresponding decimal value, and Excel uses it for further calculations.
=10/(60%24) =0.006944
Formula to round to the nearest 1 hour:
=MROUND( time, "1:00")Toggle between relative and absolute reference. First, select the cell
that contains the formula and use the F2 shortcut to enter the cell edit
mode. Then, press F4 to switch between the reference types.
Apply autocomplete formula function. First, type an equal sign (=)
and type the first character of the function. Excel shows a dynamic list
of built-in functions. Next, select the function that you want to use.
File Home Insert Page Layout Formulas Data Review View RC Developer
4. dX cut KA
pane FECorr ~ Br U~lH-|%
Undo Gipboara 5 font Atgnme
AVERAGE vlailx v Bll a
dM | cc | | ce | re | eh | vw |
itl
2 Returns the k-th largest volucin o date set. For oxample the fith largest number
ea
4|
5
i
Use Function ScreenTips. Type an equal sign and enter the function
name. To add arguments, type the opening parenthesis. A screen tip will
appear and show your formula’s corresponding argument.—
—
rine a rere rer tte rere TYPES PE PEERED IESE RETEST
articles below:
* Absolute reference
© Relative reference
© Structured references
«© Mixed reference
‘* Subtraction formula in Excel
«Fix Formula reference errors
+ Named ranges
* How to use the Name box
* Formula Bar
ional resources:
* Conditional Formatting
‘* Excel Dashboard Training
* Data Analysis in Excel
imate Dashboard Toolsé
@ N
ScoreMeter ScoreMeter
Charts» Charts »
hill
i
Variance Variance Variance
2- 3+ ae
TeeMap Gantt
Chart
Racial
Bar
Ring
Chart
Varience
te
Waterfall
Chats »
=
Og
Chart
Pro Dashboard Add-in for Excel, Fully automated. Lightweight, No coding skills required.
Get it now
Topics
Formulas
Functions
Excel Dashboard
Shortcuts
Excel Tables
Data visualization in Excel
Privacy Policy Terms of Service
Refund Policy Contact us
About Us