02 Excel Functions
02 Excel Functions
Item Sales
Orange Sugar Danish Pastries 1000
Chocolate Pasteries 600
Strawberry Crossover Puff
500
Pastries
Cherry-Almond Danish 250
Almond Breakfast Pastries 350
Cherry Pinwheel Pastries 450
Guava & Cream Cheese Pastry 850
Cinnamon Twists 950
Toblerone Danish Pastry 750
Cherry Cheese 1100
Raspberry Pastry Braid 1250
Cherry cakes 1100
Cherry pie 1450
Classic Apple Pie 300
Cherry Cheese 100
Cinnamon Sugar Wheels 600
Simple Egg and Cheese Tartlets 400
Pumpkin Spiced Danish 890
Easy Apple Turnovers 1000
Flatbread with Burrata Cheese 250
Chicken Pot Pie 550
Mixed Berry Almond Croissants 950
Chocolate Pasteries 1150
SUM: 16790
COUNT 23
AVERAGE
MAX
MIN
LEFT
LEFT: It extracts specific characters from a cell/string starting from the left (star
NIDHI NI
RIGHT
1. RIGHT: It extracts specific characters from a string starting from the right (las
NIDHI =RIGHT(A74,3)
LEN
LEN function returns the count of characters in the value.
NIDHI .=LEN(A79)
1/22/2016 0:00 5
SUBSTITUTE FUNCTION
Hello World =LEN(A83)
=LEN(SUBSTITUTE(A83," ",""))
MID Function
MID returns a substring from a string using a specific position and number of cha
LOWER Function
LOWER returns the string after converting all the letters in small
UPPER Function
The UPPER function returns the string after converting all the letters in the capital.
PROPER Function
The PROPER function returns the text string into a proper case. In simple words, with a PRO
REPT Function
REPT function returns a text value several times.
Text No of Repeats
1 10
from the left (start). You need to specify the text and number of characters to extract
=LEFT(A69,3)
from the right (last). You need to specify the text and number of characters to extract.
LEN function counts the characters in the value of a cell and is not concerned with formatti
ple words, with a PROPER function where the first letter of the word is in capital and rest in small
1111111111
aracters to extract
aracters to extract.
DATE
To add a number of years, months and/or days, use the DATE function.
=DATE(YEAR(A3)+2,MONTH(A3)
NOW
Current Date & Time
To get the current date and time, use the NOW function.
12/5/2024 5:52
TODAY()
use the TODAY function to enter today's date in Excel.
=TODAY()
DATEVAUE(date ###
01/01/1900 1 3/10/1971
10/3 =DATEVALUE(A29) If there is no year in the textual date, it will take
DAYS Function
DAYS function returns the difference between two dates. It takes a start date and an end d
EDATE(start_date,months)
EDATE function returns a date after adding a specified number of months to it.
NETWORKDAYS(start_date,end_date,holidays)
the difference between two dates, after excluding Saturdays and Sundays, and holidays (w
start date end date difference
3/13/2022 11/13/2022 =NETWORKDAYS(A49,B49)
NETWORKDAYS.INTL(start_date,end_date,weekend,holiday
NETWORKDAYS.INTL Function returns the count of days between the start date and end date. Unlike NETWO
1 to take Sunday – Saturday as the weekend.11- only Sunday
start date end date weekend
3/13/2022 11/13/2022 1
3/13/2022 11/13/2022 11
WEEKNUM(serial_number,return_type)
WEEKNUM function returns the week number of a date.
serial_number: A date for which you want to get the week number.
[return_type]: A number to specify the starting day of the first week of the year. You have two systems to
49
Date
I am given the year, month, and day of the month for a date. Is there an easy way to recov
YEAR MONTH DATE
2022 12 23
DATEDIF
My business has purchased and sold machines. For some, I have the date the machine was
bought 11/11/2013
sold 12/23/2022
year 9
months 109
DATE 3329
" characters. To enter a time, use the ":" (colon). You can also enter a date and a time in
13-03-2022
=MONTH(D3)
2022
E(YEAR(A3)+2,MONTH(A3)+2,DAY(A3)+9)
e NOW function.
date in Excel.
here is no year in the textual date, it will take the current year as the year.
two dates. It takes a start date and an end date and then returns the difference between them in d
12/13/2022
difference
=NETWORKDAYS(A52,B52,C52:C54)
s between the start date and end date. Unlike NETWORKDAYS, NETWORKDAYS.INTL lets you specify which days you wa
difference
Sat and Sunday
=NETWORKDAYS.INTL(A61,B61,C61)
Sunday
=NETWORKDAYS.INTL(A62,B62,C62)
holiday difference
10/21/2022 =NETWORKDAYS.INTL(A65,B65,C65,D65:D67)
10/24/2022
10/5/2022
e week number.
of the first week of the year. You have two systems to specify the starting date of the week.
onth for a date. Is there an easy way to recover the actual date?
12/23/2022
s. For some, I have the date the machine was purchased and the date the machine was sold. Can I
te and a time in one cell.
e was sold. Can I easily determine how many months we kept these machines?
Hour, Minute, Second ###
HOUR =HOUR(B1)
MINUTE =MINUTE(B1)
SECOND =SECOND(B1)
TIME
Time Function
To add a number of hours, minutes and/or seconds, use the TIME function.
=TIME(HOUR(B1)+1,MINUTE(B1)+3,SECOND(B1)+21)
TIME(hour,minute,second)
TIMEVALUE(time_text)
TIMEVALUE funtion returns time after converting a text which represents a time into actual time.
11:08 0.463888888888889
12:00 am 0
PATIENTS TIME
A 5:00
B 05:20:00
C 05:40:00
D 06:00:00
E 06:20:00
F 06:40:00
, use the TIME function.
up to 5:00 PM. How can I enter in different rows the list of possible appointment times?
:00
:00
:00
:00
:00
COUNT
Count Words from a Single Cell
To count words from a cell you need to combine the LEN function with the SUBSTITUTE functi
That means you will always have one word more than the spaces. The idea is simple: If you w
Hello World =LEN(A5)-LEN(SUBSTITUTE(A5," ",""))+1
11 10
N World
Names
Phuong Phuong
Chi Chi
Breanne Breanne
Adelia Adelia
Sharell Sharell
Julianne Julianne
Flavia Flavia
Juliet Juliet
Casandra Casandra
Marni Marni
Chi
Breanne
Adelia
Flavia
Juliet
Casandra
Chi
Chi
COUNTA
1 COUNT
2 COUNTA
E
R
T
@
*
Use the COUNTBLANK function, one of the Statistical functions, to count the numbe
Names
JOHN =COUNTBLANK(A56:A67)
JOHN
JOhn
Sharell
John
Juliet
Marni
Chi
Breanne
Unlike the older COUNTIF function, COUNTIFS can apply more more than one condition at the
Criteria can include logical operators (>,<,<>,=) and wildcards (*,?) for partial matching.
David Yes
John Yes
Sundar Yes
Leena No
Data
1 5/1/2011
2 5/2/2011
3 5/3/2011
4 5/4/2011
5 5/5/2011
6 5/6/2011
ion with the SUBSTITUTE function. And the formula will be (Text is in cell A1):=LEN(A1)-LEN(SUBSTITU
ces. The idea is simple: If you want to count the words, count the spaces and add one to them.
" ",""))+1
10
dvanced filters.
nique values.
;=COUNT(A45:A51)
=COUNTA(A45:A51)
n a range.
more than one condition at the same time. Conditions are supplied with range/criteria pairs, and only
ds (*,?) for partial matching.
Exceeded Q2 quota
No
Yes
Yes
Yes
nd the formula will be (Text is in cell A1):=LEN(A1)-LEN(SUBSTITUTE(A1,” “,””))+1
o count the words, count the spaces and add one to them.
Only Numeric Values
All values
Exceeded Q3 quota
No
No
Yes
Yes
TITUTE(A1,” “,””))+1
only the first pair is required. For each additional condition, you must supply another range/criteria pai
apples 32
oranges 54
peaches 75
apples 86
Apricots 71
Avocados 80
Banana 11
Bilberry 9
Blackberry 15
Blackcurrant 91
Cherries 78
Cucumbers 10
Grapefruit 75
Jackfruit 95
Kiwi 98
Lime 71
Papaya 75
Strawberries 70
Zucchini 78
Apricots 89
Avocados 81
Avocados 87
Sum the number of cells with apples
=SUMIF(A2:A25,A2,B2:B23)+SUMIF(A2:A25,A3,B2:B23)
=SUMIF(B2:B25,">55")
=SUMIF(B2:B23,"<>75")
=SUMIF(B2:B23,"<=85")-SUMIF(B2:B23,"<32")
=SUMIF(A2:A25,"*", B2:B25)
=SUMIF(A2:A5,"?????es",B2:B5)
118
3,B2:B23)
23,"<32")
COUNTIF
Formula to Count Cells with Specific Text
Names =COUNTIF(A3:A19,A11)
Phuong
Chi
Breanne
Adelia
Sharell
Julianne
Flavia
Juliet
Casandra
Marni
Chi
Breanne
Adelia
Flavia
Juliet
Casandra
Count Cells with Text in Excel
COUNTIF with Wildcard Characters to Count Cell with Text Values
Names Text Values Only
Phuong
Chi
Breanne
9653426928
Adelia
Sharell
Julianne
Flavia
Juliet
Casandra
4445986933
Marni
9653426928
Chi
Breanne
Adelia
9254615162
Flavia
Juliet
Casandra
Data Sales
apples 32
oranges 54
peaches 75
apples 86
Apricots 71
Avocados 80
Banana 11
Bilberry 9
Blackberry 15
Blackcurrant 91
Cherries 78
Cucumbers 10
Grapefruit 75
Jackfruit 95
Kiwi 98
Lime 71
Papaya 75
Strawberries 70
Zucchini 78
Apricots 89
Avocados 81
Avocados 87
COUNTIF is not case-sensitive.
COUNTIF only supports one condition. Use the COUNTIFS function for multiple criteria.
Text strings in criteria must be enclosed in double quotes (""), i.e. "apple", ">32", "ja*"
Cell references in criteria are not enclosed in quotes, i.e. "<"&A1
The wildcard characters ? and * can be used in criteria. A question mark matches any one cha
COUNTIF requires a range, you can't substitute an array.
COUNTIF returns incorrect results when used to match strings longer than 255 characters.
COUNTIF will return a #VALUE error when referencing another workbook that is closed.
9,A11)
xt Values
=COUNTIF(A23:A42,"*")
Counts the number of cells with apples
=COUNTIF(A47:A70,A49)
4
=COUNTIF(A47:A70,A47)+COUNTIF(A47:A70,A48)
r and an asterisk matches any sequence of characters (zero or more).
7:A70,A48)
e).
AVERAGEIF
AVERAGEIF is commonly used in finding the average of cells that are an exact matc
Item Sales
Orange Sugar Danish Pastries 1000
Chocolate Pasteries 600
Strawberry Crossover Puff Pastries 500
Cherry-Almond Danish 250
Almond Breakfast Pastries 350
Cherry Pinwheel Pastries 450
Guava & Cream Cheese Pastry 850
Cinnamon Twists 950
Toblerone Danish Pastry 750
Cherry Cheese 1100
Raspberry Pastry Braid 1250
1100
Cherry pie 1450
Classic Apple Pie 300
Cherry Cheese 100
Cinnamon Sugar Wheels 600
Simple Egg and Cheese Tartlets 400
Pumpkin Spiced Danish 890
Easy Apple Turnovers 1000
Flatbread with Burrata Cheese 250
Chicken Pot Pie 550
Mixed Berry Almond Croissants 950
Chocolate Pasteries 1150
rage of cells that are an exact match of a given criterion
=AVERAGEIF(A5:A27,A6,B5:B27)
=AVERAGEIF(A5:A27, "*Pastries",
B5:B27)
=AVERAGEIF(A5:A27,
"<>*(Pastries)", B4:B27)
=AVERAGEIF(B5:B27,">500")
=AVERAGEIF(A5:A27,"?????????????",
B5:B27)
with wildcard characters!
AVERAGEIFS
The AVERAGEIFS function calculates the average of the numbers in a range that me
range given to AVERAGEIFS is the range containing numbers to average. Criteria ar
criteria] and only the first pair is required. For each additional criteria, supply anot
criteria given to AVERAGEIFS are applied with AND logic – all criteria must be true f
in the average.
=AVER
AGEIFS(
D8:D11,
D8:D11,
Emilio 75 85 87 "<>Inc
omplete
",
D8:D11,
">80")
Julie 94 80 88
Hans 86 93 Incomplete
Incom
Frederique 75 75
plete
Example 2
Number of Garage
Type Price Town
Bedrooms ?
Cozy Rambler 230000 Issaquah 3 No
Snug
197000 Bellevue 2 Yes
Bungalow
Cool Cape
345678 Bellevue 4 Yes
Codder
Splendid Split
321900 Issaquah 2 Yes
Level
Exclusive
450000 Bellevue 5 Yes
Tudor
Classy
395000 Bellevue 4 No
Colonial
of the numbers in a range that meet supplied criteria. The first
g numbers to average. Criteria are supplied in pairs [range,
h additional criteria, supply another range/criteria pair. The
D logic – all criteria must be true for a number to be included
Average first quiz grade that falls between 70 and 90 for all
students (80.5). The score marked "Incomplete" is not
included in the calculation because it is not a numerical
value.
Data
1 5/1/2011
2 5/2/2011
3 5/3/2011
4 5/4/2011
5 5/5/2011
6 5/6/2011
apply more more than one condition at the same
pairs, and only the first pair is required. For each
ge/criteria pair. Up to 127 range/criteria pairs are
=COUNTIFS(B6:B9,"=Yes",C6:C9,"
=Yes")
=COUNTIFS(B9:D9,"=Yes",B7:D7,"
=Yes")
=COUNTIFS(A15:A20,"<6",A15:A2
0,">1")
=COUNTIFS(A15:A20,
"<5",B15:B20,"<5/3/2011")
FIND Function
Data Find
DATA is not correcT T
DATA is not correct t
Revenue grew by 5% Revenue
Original Text Text
Original Text z
The FIND function returns the position (as a number) of one text string inside another.
If there is more than one occurrence of the search string, FIND returns the position of the fi
The FIND function always case-sensitive:
Arguments
find_text - The substring to find.
within_text - The text to search within.
start_num - [optional] The starting position in the text to search. Optional, defaults to 1.
ISNUMBER
TRUE OR FALSE RESULT
1
=ISNUMBER(FIND("Z","apple"))
SEARCH
Data Find
DATA is not correct t
DATA is not correct t
In this example,
we will filter out
the first and last
names from the
full names using
the SEARCH in
excel
Wildcards
Although SEARCH is not case-sensitive, it does support wildcards (*?~).
* It is to match zero or the number of characters. So, for example, “Fi*
? It is used to match any single character. For example, “Fa? e” could m
Tilde (~) It is used to match wildcard characters in the word. So, for example,
XYZ 1
XYY =ISNUMBER(SEARCH("*z",A57))
XYZ =ISNUMBER(SEARCH("?Y?",A58))
IFERROR
You could use IFERROR to wrap the SEARCH function, and display a message, if the result i
text string Z
Formula
3
11
1
=FIND(B8,A8,1)
#NAME?
Formula
11
3
LAST NAME
=RIGHT(A39,LEN(A39)-SEARCH(" ",A39)) 8
SHARMA
SARDA
PALIWAL
JAIN
SINGH
SINGH
JAIN
rt wildcards (*?~).
er of characters. So, for example, “Fi*” could match “Final, Fitting, Fill, Finch, and Fiasco,” etc.
haracter. For example, “Fa? e” could match “Face” & “Fade,” “?ore” could match “Bore” & “Core,” “
racters in the word. So, for example, if you have the word “Hello*” to find this word, we need to fram
=--ISNUMBER(SEARCH("*z",A56))
=--ISNUMBER(SEARCH("*z",A57))
=--ISNUMBER(SEARCH("?z?",A58))
and display a message, if the result is an error. The IFERROR is available in Excel 2007 and later ve