Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 40

Microsoft Excel has 4 logical functions to work with.

Function Formula Example

AND =AND(A2>=10, B2<5)


OR =OR(A2>=10, B2<5)
XOR =XOR(A2>=10, B2<5)
NOT =NOT(A2>=10)

IF function
Tests a supplied condition. Return one result, if condition evaluates TRUE and

sysntax:- if(logical condition,value_if_true,value_if_false).

Example : - 5 Greater than zero


-9 Number is less than zero
Formula Arguments of Logical functions - References,Numbers,Text,
Description

The formula returns TRUE if a value in cell A2 is greater than or equal to 10, and a v
The formula returns TRUE if A2 is greater than or equal to 10 or B2 is less than 5, or
The formula returns TRUE if either A2 is greater than or equal to 10 or B2 is less tha
The formula returns FALSE if a value in cell A21 is greater than or equal to 10; TRUE

condition evaluates TRUE and another result if condition evaluates to FALSE.

_if_false).

5
han zero
nces,Numbers,Text,Formulas and other Excel functions. All should evaluvate to TRUE OR FALSE

qual to 10, and a value in B2 is less than 5, FALSE otherwise.


B2 is less than 5, or both conditions are met. If neither of the conditions it met, the formula re
10 or B2 is less than 5. If neither of the conditions is met or both conditions are met, the form
equal to 10; TRUE otherwise.
vate to TRUE OR FALSE

it met, the formula returns FALSE.


tions are met, the formula returns FALSE
String Functions are to manipulate the text entered .

LEN Function To find the length of the specified string


Syntax LEN(text)
Length of the string
Hello 5
Hello world 11
12 2
0
Right Function Returns the number of characters from the end of the supplie
Syntax RIGHT(text,[num_chars])
Right Caharacters
Hello o
Helo world world
1234 4

Note:- if num_chars are omitted, default it takes as one.

LEFT function Returns the number of characters from the start of the suppli
Syntax LEFT(text,[num_chars])
Left Chars
Hello H
Hello World Hello
Hello World Hello W

MID Function returns a specified number of characters from the middle of a


Syntax MID(text,start_num,num_chars)
start_num - postion of the first character that you want to be
num_chars - number of characters to be returned
Hello H
Helo world elo
Hello World World

PROPER Function The Excel Proper function converts all characters in a supplied
Syntax PROPER(text)
this is a string This Is A String
THIS IS A STRING This Is A String
233xst Test 233Xst Test
mr.Navin's car Mr.Navin'S Car

UPPER Function The Excel Upper function converts all characters in a supplied
Syntax upper(text)

test TEST
TEST TEST

Lower Function The Excel Lower function converts all characters in a supplied
Syntax lower(text)

HELLO hello
Text text
This IS a test this is a test

Exercises
1.Find the length of your name
2.Find the sur name of your full name

CONCATENATE Function Concatenate function joins together a series of supplied text s


Syntax CONCATENATE( text1, [text2], ... )

Jane smith Jane smith


Manish Patel Manish Patel
Paul Jones Paul Jones
Geetha Gupta Geetha Gupta

TRIM Function removes extra spaces (i.e. all spaces except for single spaces b
Syntax TRIM( text )

Hello World Hello World


Hello World Hello World
Hello world Hello world

FIND Function The Excel FIND function returns the position of a specified cha
Syntax FIND( find_text, within_text, [start_num] )

find_t -
withi -
[start_nu-

Example

Original Text 10
Original Text 13
Original Text 5

Replace Function The Excel Replace function replaces all or part of a text string with anoth
Syntax REPLACE( old_text, start_num, num_chars, new_text )
old_te -

start_ -

num_c -
new_te -

Example
Test String Check String
e length of the specified string

e number of characters from the end of the supplied string


,[num_chars])

efault it takes as one.

e number of characters from the start of the supplied string


num_chars])

pecified number of characters from the middle of a supplied text string.


tart_num,num_chars)
- postion of the first character that you want to be returned
s - number of characters to be returned

Proper function converts all characters in a supplied text string to proper case (i.e. all letters that do not imme
Upper function converts all characters in a supplied text string to upper case.

Lower function converts all characters in a supplied text string to lower case.

te function joins together a series of supplied text strings or other values, into one combined text string.
NATE( text1, [text2], ... ) max is 255 text arguments

xtra spaces (i.e. all spaces except for single spaces between words or characters) from a supplied text string.
FIND function returns the position of a specified character or sub-string within a supplied text string.
_text, within_text, [start_num] )

The character or sub-string that you wish to find.


The text string that is to be searched.
An optional argument that specifies the position in the within_text string, from w
If omitted, this takes on the default value of 1 (i.e. begin the search at the start

place function replaces all or part of a text string with another string.
d_text, start_num, num_chars, new_text )
The original text string, that you want to
replace a part of.
The position, within old_text, of the first
character that you want to replace.
The number of characters to replace.
The replacement text.
Don’t use Right functions with the date. In Excel, the Date is stored as numb

(i.e. all letters that do not immediately follow another letter are set to upper case and all other characters are
one combined text string.
max is 255 text arguments

rs) from a supplied text string.


a supplied text string.

within_text string, from which the search should begin.


n the search at the start of the within_text string)
Date is stored as numbers.Only cell formatting makes them appear as dates.Use Day,Month and Year functio

d all other characters are lower case).


nth and Year functions to get the separate part of the date.
To enter a date use "/" or "-" . Time -use ":"
Excel stores Date and Times as positive integers.
1 12/31/1899 converted into date format
42736 1/1/2017

Times in Excel are stored as decimals, between 0 and 1, which represent a proportion of the day.

0 12:00:00 AM
0.25 6:00:00 AM
0.5 12:00:00 PM noon
0.75 6:00:00 PM
0.8 7:12:00 PM
0.9 9:36:00 PM
1 12:00:00 AM
How Excel stores date and time
1.5 12/31/1899 12:00
42736.25 1/1/2017 6:00

Since Excel stores date and Time as numbers, we can do all arithmetic operations.

/Now()
Now() - 10/9/2019 13:39
How to find the difference between two dates ?

Date 1 19-Jul-18
Date 2 25-Jul-18
Difference 6

Difference between two times


Time 1 13:00
Time2 18:00
Difference 5:00

Difference between two dates and times


Date&Time 7/19/2018 10:40
Date&Time 7/19/2018 14:30
Difference 3:50:00 //formatted as HH.MM:SS

Example 1 To check whether appoint time is due or not.

Appointment Time 12/18/2018 12:40


Current date and time 10/9/2019 13:39
Differennce 23:00:15 Appointment is Due !!!

Today() Returns current date.


10/9/2019

How to find the number of days that have passed since 17,May,2010.
Days passed
17-May-18 510 //format as general

Date Function converts a supplied year, mo


Syntax date(year,month,day)

Day Month Year


17 7 2018

Alter 1
if year is between 1 and 1899,
then it is added to 1900 date(1,1,1)= 1/1/1901
ex:- date(100,1,1) 1/1/2000

Alter2

if month is given a negative


number or greater than 12, the
date extends backward or
forward into previous or
following year date(2018,-1,1) 11/1/2017
date(2018,13,04) 1/4/2019

Alter3

if day is given negative or greater


than 31,the date extends
backward of forward into
previous or following year date(2018,12,0) 11/30/2018
date(2018,12,33) 1/2/2019
DATE(2018,12,35) 1/4/2019
DATE(2018,12,-1) 11/29/2018
Day360 Function number of days between 2 dates, based on a 360-day year (12 x 30 days).
Syntax DAYS360( start_date, end_date, [method] )

1-Jul-18 14
15-Jul-18 14
When the start date is last day of the month, In US or European method, it Is set to 30 .
31-Jul-18 15
15-Aug-18 15
If end date is last day of the month, if the start date is < 30 then end date is set to first of the next month
otherwise end date becomes 30th of the same month.

29-Aug-18 62
31-Oct-18 61
1-Nov-18 62
64

Days Function returns the number of days between two supplied dates.
Syntax DAYS( end_date, start_date )

18-Jul-18 31
18-Aug-18
31

#VALUE! How many days left for new year


onverted into date format

//displays current date and time

/formatted as HH.MM:SS
Appointment is Due !!!

/format as general

converts a supplied year, month and day into an Excel date. All arguments are integerYear -1900 and 9999,Day

Date Function 12/25/2017


7/17/2018 653.00

ay year (12 x 30 days).


Difference between days and days360 function is
he next month days function is based on 365 days ,normal calendar year

days360 is 12 months with 30 days. This is for accounting purpose.

here oct=30,sep=30 and two days in August


Year -1900 and 9999,Day -1 and 31 ,date is 1and 31
Count Function
Syntax

Example
2
4 5
0
test 0
23-Jul-18 10

CountIF Function
Syntax

SUMIF Function
Syntax

AVERAGEIF
Syntax

Example
Monday 500
Tuesday 50
Thursday 100
Firday 100
Thursday 200
5 300 1
2 200 2
3 100 3
4 50 4
5 100 5
1 50
1 200
1 250
0 50

Profits
Region
(Thousands)
East 45678
West 23789
North -4789

South (New Office) 3456

MidWest 9678
East(New Office) 34567

AVERAGEIFS( average_range, criteria_range1, criteria1

1 Quarter Area
2 1 North
3 1 North
4 1 South
5 2 North
6 2 North
7 2 South
8 3 North
9 3 North
10 3 South
11 4 North
12 4 North
13 4 South
14 4 North

find the average quarterly sale, per person, in the North area during quarter 1:

find the average sales figure for "Jeff", during quarters 3 and 4:
find the average sales of reps whose name starts with "C" in North Area ?

Find the average sales of "Carol" in South Area ?

Find the average sales per person ,in North Area during Quarter 4

Student First Second


Quiz Quiz
Grade Grade
Emilio 75 85
Julie 94 80
Hans 86 93
Frederique Incomplete 75

Average first quiz grade that falls between 70 and 90 for all students (80.5). The score marked "Incomplete

80.5
Average second quiz grade that is greater than 95 for all students.

#DIV/0! Because there are no scores greater than 95, #DIV0! is returned.
Average final exam grade that is greater than 80 for all students

87.5

Find The average scores of students in Final Exam > 80 and their names ending with "e"
88

Product Quantity Price


Computer 2 1000
Key Board 4 xys
Mouse 4 100
Printer 2 abc

2400
returns the count of numeric values in a supplied set of cells or values. This count includes both numbers and dates.
COUNT( value1, [value2], ... )

Count
COUNT(A6:A10) 4

COUNT(A6:B10) 6

returns the number of cells within a supplied range, that satisfy a given criteria.
COUNTIF( range, criteria )

The supplied criteria can be either: A numeric value (which may be an integer, decimal, date
A text string (e.g. "Text", "Monday"), which may include w
An expression (e.g. ">12",
You can use wild chars such as ? Or *

finds the values in a supplied array, that satisfy a given criteria, and returns the sum of the corresponding values in a
SUMIF( range, criteria, [sum_range] )
range -
[sum_range] -

returns the average (i.e. the statistical mean) of the corresponding values in a second supplied array.
AVERAGEIF( range, criteria, [average_range] )
150 AVERAGEIF(A33:A46,"Thursday",B33:B46)
200 AVERAGEIF(A33:A46,5,B33:B46)
137.5 AVERAGEIF(A33:A46,">2",B33:B46)
225 AVERAGEIF(A33:A46,TRUE,B33:B46)
150 AVERAGEIF(A33:A46,"<>true",B33:B46)

Average of all profits for the West and MidWest regions.


16733.5

Average of all profits for all regions excluding new offices.

18589
Average of all profits where region has new office
19011.5

e1, criteria1, [criteria_range2, criteria2], ... )

Sales Rep. Sales


Jeff ₹ 223,000.00
Chris ₹ 125,000.00
Carol ₹ 456,000.00
Jeff ₹ 322,000.00
Chris ₹ 340,000.00
Carol ₹ 198,000.00
Jeff ₹ 310,000.00
Chris ₹ 250,000.00
Carol ₹ 460,000.00
Jeff ₹ 261,000.00
Chris ₹ 389,000.00
Carol ₹ 305,000.00
Carol ₹ 105,000.00

h area during quarter 1: ₹ 174,000.00

₹ 285,500.00
"C" in North Area ? ₹ 241,800.00

₹ 354,750.00

₹ 251,666.67

Final
Exam
Grade
87
88
Incomplete
75

and 90 for all students (80.5). The score marked "Incomplete" is not included in the calculation because it is not a nu

n 95 for all students.

ere are no scores greater than 95, #DIV0! is returned.


80 for all students

87.5

and their names ending with "e"

non numeric values , it will treat as zero.


s count includes both numbers and dates.

may be an integer, decimal, date, time, or logical value) (e.g. 10, 01/01/2008, TRUE)
", "Monday"), which may include wildcards

s the sum of the corresponding values in a second supplied array.

An array of values (or range of cells containing values) to be tested against the supplied
An optional array of
numeric values (or
cells containing
numeric values),
which are to be
added together, if
the corresponding
range entry satisfies
the supplied criteria.
If the [sum_range] argument is omitted, the values from the range argument are summed i

n a second supplied array.


n the calculation because it is not a numerical value.
nst the supplied criteria.

ment are summed instead.


MIN function The Excel MIN function returns the smallest numeric value in a range of values.
The MIN function ignores empty cells, the logical values TRUE and FALSE, and text values.

Syntax =MIN (number1, [number2], ...)

Example
5
1

MAX Function The Excel MAX function returns the largest numeric value in a range of values. The

Syntax =MAX (number1, [number2], ...)

Example
Student IDInternal m External Mtotal Marks
ST001 20 15 35
ST002 30 38 68
ST003 18 19 37
ST004 43 45 88
ST005 38 43 81
ST006 32 38 70
ST007 45 43 88
ST008 25 20 45
ST009 39 42 81
ST010 37 40 77

What is the maximum total score 88


What is the minimum total score 35
What is the average total score 67

AVERAGE function returns the arithmetic mean of a list of supplied numbers.


Syntax AVERAGE( number1, [number2], ...max=255 )

Example 20.1 20 23.5 22.1 24.7 Average = 22.08

MEDIAN function returns the statistical median (the middle value) of a list of supplied numbe
Syntax MEDIAN( number1, [number2], ... )

If there is an even number of values in the supplied data set, the average of the two middle v
If a supplied array contains empty cells, text, or logical values, these values are ignored when
In current versions of Excel (Excel 2007 & later), you can provide up to 255 number

Example
14 15 17 15

13 14 25 30 19.5 19.5

13 18 20 17 17.5 19

if middle values are greater than the last values, it finds avg and comapre with the n

Mode Function statistical mode (the most frequently occurring value) of a list of supplied num
Syntax MODE( number1, [number2], ... )

Example
1 1 2 2 3 4 4 5 5
1 1 2 2 3 4 4 6 5

STDEV function sample standard deviation of a supplied set of values.

Syntax STDEV( number1, [number2], ... )

The Standard Deviation is a statistical measure, that is used to identify the amount that a set of values differ (or devi

Example
10 20 30 40 50 60 STDEV 18.70829

Find the stddev of the student marks


Student NMarks which stddev ,you use ?
ST001 60 14.44611
ST002 78
ST003 80
ST004 45
ST005 54
ST006 74
ST007 66
ST008 88
ST009 73
ST010 43

A researcher has recruited males aged 45 to 65 years old for an exercise training study to inv

One of the questions on a national consensus survey asks for respondents' age. Which standa
VAR Function returns the sample variance of a supplied set of values.

Syntax VAR( number1, [number2], ... )

231.8778 231.8778 Both sample variance and var are the same.
ue in a range of values.
and text values.

e in a range of values. The MAX function ignores empty cells, the logical values TRUE and FALSE, and text

d numbers.

e) of a list of supplied numbers.

rage of the two middle values is returned;


values are ignored when calculating the median.
o 255 number arguments to the Median function
19 19.5 18.25 17.75

nds avg and comapre with the next value/then again find avg

value) of a list of supplied numbers. If there are 2 or more most frequently occurring values in the supplied data, the function re

5 Mode= 5
5 mode= 1

t a set of values differ (or deviate) from the average value

18.70829 Both stddev.s and stddev are the same

ise training study to investigate risk markers for heart disease (e.g., cholesterol). Which standard devi

dents' age. Which standard deviation would be used to describe the variation in all ages received from
UE and FALSE, and text values.
supplied data, the function returns the lowest of these values

ol). Which standard deviation would most likely be used?

n all ages received from the consensus?

You might also like