Excel Formula1.1
Excel Formula1.1
Excel Formula1.1
How to read this book? This book explains 75 very commonly used Microsoft excel formulas in plain English. The best way to read this book is to read few formulas at a time and then practice them on using excel. Each formula is explained with description, syntax and 2 examples. I suggest you to give these formulas a try by typing them in excel. For more information on excel formulas, do visit the following links: http://chandoo.org/wp/tag/formulas http://chandoo.org/excel-formulas http://chandoo.org/wp/category/excel All the best
Average Countif
Sumif Averageif Countblank Round Int
Subtotal Sign
Product Abs Floor Ceiling Roman
Or Not
Choose Iserror Isblank Isnumber Istext
Mid Lower
Upper Proper Len Find Trim
Match Index
Row Column
Small Large
Mode Median Rank Percentile
Year Month
Day Weekday Hour Minute Second
Pmt Ipmt
Ppmt
Mod
Iferror
Dollar
Value Substitute Rept Text
Datevalue
Timevalue Networkdays
Type
Sum
Wh a t it does?
Sy n t a x
Count
Wh a t it does?
count(range of cells)
Exa m pl e
count(1,2,3,4,5,6,"hello",7,8) = 8 (ignores the text value hello) Note: if you want to count only blank cells, use countblank() instead
Average
Wh a t it does?
Sy n t a x
Countif
Wh a t it does?
Sy n t a x
countif(A1:A20, 1) = counts how many cells have "1" countif(A1:A20, "<3") = counts how many cells have less than 3
Sumif
Wh a t it does?
Sy n t a x
sumif(A1:A20, 3) = sums the cells with a value of "3" sumif(A1:A20, 3, b1:b20) = same as above but adds values in B1:B20
Averageif
Wh a t it does?
averageif(in this range, values meeting this criteria, [use this range for average])
Exa m pl e
averageif(A1:A20, ">5") = average of all the values above 5 in A1:A20 averageif(A1:A20, "Bob", B1:B20) = Average of all values in B1:B20 where the corresponding row in A has "Bob"
Countblank
Wh a t it does?
Sy n t a x
Round
Wh a t it does?
Sy n t a x
Int
Wh a t it does?
int(this number)
Exa m pl e
int(1.2365) = 1
Mod
Wh a t it does?
Tells you what is the reminder after dividing one number with another
Sy n t a x
mod(5,3) = 2 mod(3,5) = 3
Rand
Wh a t it does?
Sy n t a x
rand()
Exa m pl e
Randbetween
Wh a t it does?
randbetween(0,100) = returns a random number between 0 and 100 Note: if you are using excel 2003 or earlier, you need to enable this function by adding analysis toolpak add-in.
Subtotal
Wh a t it does?
tells you the sum, average, count, standard deviation etc. of a list of numbers.
Sy n t a x
subtotal(<function number>,list-of-values)
Exa m pl e
subtotal(1,scores_list) = average of the scores_list Note: function number 1 - Average, 2 - Count, 3 - Counta, 4 - Max, 5 - Min, 6 - Product, 7 Standard Deviation, 8 - STDEVP, 9 - Sum
Sign
Wh a t it does?
tells you the sign of a number, 1 for positive, 0 for zero and -1 for negative values
Sy n t a x
Product
Wh a t it does?
Sy n t a x
product(list of numbers)
Exa m pl e
Abs
Wh a t it does?
Sy n t a x
abs(some number)
Exa m pl e
Floor
Wh a t it does?
Sy n t a x
Ceiling
Wh a t it does?
Sy n t a x
ceiling(3.678,1) = 4 (since 4 is the nearest multiple of 1 away from zero) ceiling(89,2) = 90, ceiling(-89,-2) = -90
Roman
Wh a t it does?
Sy n t a x
roman(number)
Exa m pl e
If
Wh a t it does?
And
Wh a t it does?
Sy n t a x
and(list of conditions)
Exa m pl e
Or
Wh a t it does?
Sy n t a x
or(list of conditions)
Exa m pl e
Not
Wh a t it does?
Sy n t a x
Choose
Wh a t it does?
selects one of the parameters based on first parameter. Works like a really big nested IF()
Sy n t a x
choose(3,"value 1", "value2", "another value") = another value choose(int(test_score/20),"F","D","C","B","A") = tells you the letter grade for the given score
Iserror
Wh a t it does?
Sy n t a x
iserror(this value)
Exa m pl e
Isblank
Wh a t it does?
Sy n t a x
isblank(this value)
Exa m pl e
Isnumber
Wh a t it does?
Sy n t a x
isnumber(this value)
Exa m pl e
Istext
Wh a t it does?
Sy n t a x
istext(this value)
Exa m pl e
Iferror
Wh a t it does?
An easy way to handle errors in formulas. IFERROR returns the value you want incase of an error with the formula
Sy n t a x
Concatenate
Wh a t it does?
Interesting Tip
Sy n t a x
You can use & operator instead of concatenate(). For eg. =one&big&text works the same way as example 1
concatenate("one ","big ","text") = one big text concatenate(A1,A2,A3) = adds the text values in A1,A2 and A3
Left
Wh a t it does?
Sy n t a x
left("Pointy Haired Dilbert rocks", 6) = Pointy left(A1,5) = first five characters in the cell A1
Mid
Wh a t it does?
Sy n t a x
Lower
Wh a t it does?
Sy n t a x
lower(this text)
Exa m pl e
Upper
Wh a t it does?
Sy n t a x
upper(this text)
Exa m pl e
Proper
Wh a t it does?
Sy n t a x
proper(this text)
Exa m pl e
Len
Wh a t it does?
Sy n t a x
Find
Wh a t it does?
Sy n t a x
Trim
Wh a t it does?
Sy n t a x
trim(this text)
Exa m pl e
trim(" unusally
Dollar
Wh a t it does?
dollar(2300,2) = $ 2,300.00 Note: Dollar() uses your excel installation currency settings. So if you use someother currency like SEK, Rs. Euro, those symbols will appear
Value
Wh a t it does?
Sy n t a x
Substitute
Wh a t it does?
substitute(in this text, this text, with this text, [at this occurance])
Exa m pl e
substitute("Pointy Haired Dilbert", "Pointy", "Curly") = Curly Haired Dilbert substitute("123-123-1234","-","") = 1231231234
Rept
Wh a t it does?
Sy n t a x
Text
Wh a t it does?
Converts something in text to a number format (works for dates and times too)
Sy n t a x
text("2300","$0,00.00") = $2,300.00 Note: you can format the text value using any formatting code. Learn more about excel cell formatting codes from below links
Type
Wh a t it does?
Sy n t a x
type("chandoo") = 2 Type returns 1 if the input is number, 2 for text, 4 for logical values, 16 for error values and 64 for arrays
Vlookup
Wh a t it does?
Searches where a value is in a list, and then returns another value from the same row. Use when you need phone number based on name etc.
Sy n t a x
vlookup(this value, in this list, and get me value in this column, [is-my-list-sorted?])
Exa m pl e
vlookup("John", list, 2, false) = finds where John is in the list and returns the value in the 2nd column Note: Use vlookup if your list is in rows and hlookup if your list is in columns
Hlookup
Wh a t it does?
Searches where a value is in a list, and then returns another value from the same column. Use when you need phone number based on name etc.
Sy n t a x
hlookup(this value, in this list, and get me value in this row, [is-my-list-sorted?])
Exa m pl e
hlookup("John", list, 2, false) = finds where John is in the list and returns the value in the 2nd row Note: Use vlookup if your list is in rows and hlookup if your list is in columns
Match
Wh a t it does?
Sy n t a x
match("bill gates", customer_list,0) = tells you position of customer named "bill gates" in the customer_list match(23, scores_list,1) = gets the position of first score greaters than 23 in the scores_list (this should be sorted from low to high)
Index
Wh a t it does?
gets you the value in a particular row (and column) of a given range of cells
Sy n t a x
INDEX(A1:C10,3,2) = gets you the value in cell B3 (which is 3rd and 2nd column in the range A1:C10 INDEX(A1:A10,15) = returns a #REF! error since there are only 10 values in the range A1:A10
Row
Wh a t it does?
Sy n t a x
Column
Wh a t it does?
Sy n t a x
Min
Wh a t it does?
Sy n t a x
Max
Wh a t it does?
Sy n t a x
Small
Wh a t it does?
Sy n t a x
Large
Wh a t it does?
Sy n t a x
Mode
What it does?
finds out the MODE of a list of values. Mode is a value with highest frequency in the list
Sy n t a x
mode(list of values)
Exa m pl e
mode(1,2,3,3,3,4,4,4,4,5,5,6,7) = 4 mode(1,2,3,4,5) = returns #N/A error since no value has highest frequency
Median
What it does?
Sy n t a x
median(list of values)
Exa m pl e
Rank
What it does?
Sy n t a x
rank(20,list of numbers) = rank of 20 in "list of numbers" (in descending order) rank(20,list of numbers, 1) = rank of 20, but in ascending order
Percentile
What it does?
Today
What it does?
Today's date
Sy n t a x
today()
Exa m pl e
Now
What it does?
Sy n t a x
now()
Exa m pl e
Year
What it does?
Sy n t a x
Month
What it does?
Sy n t a x
Day
What it does?
Sy n t a x
Weekday
What it does?
Sy n t a x
Hour
What it does?
Sy n t a x
Minute
What it does?
Sy n t a x
Second
What it does?
Sy n t a x
Datevalue
What it does?
Converts a date in the text format to excel date format (remember, you still need to format it)
Sy n t a x
DATEVALUE("31/12/2001") = 37256 (which is the excel's way of saying it is 31st December 2001) Note: Date value depends on your computer's settings. So if you use MM/DD/YYYY dates in your country, they work in the datevalue
Timevalue
What it does?
timevalue("12:30 am") = 0.020833333 (which is excel's way of saying it is almost beyond bed time) timevalue("22:00") = 0.916666667 (it works with 24H format too)
Networkdays
What it does?
Tells you how many working days are there between 2 given dates
Sy n t a x
Npv
What it does?
npv(10%,100,100,100,100,100) = 379.07
Fv
What it does?
fv(10%,12,-1000) = 21,384.28
Pmt
What it does?
Tells you how much you should pay on your mortage (every month ..)
Sy n t a x
pmt(at this rate, this many payments, for this much amount)
Exa m pl e
pmt(10%,12,-100000) = 14676.33
Ipmt
What it does?
Tells you how much of your mortgage goes towards interest in specified month
Sy n t a x
ipmt(at this rate, on this payment, out of this many payments, for this much amount)
Exa m pl e
ipmt(10%,3,12,-100000) = 9017.97
Ppmt
What it does?
Tells you how much of your mortgage goes towards principle in specified month
Sy n t a x
ppmt(at this rate, on this payment, out of this many payments, for this much amount)
Exa m pl e
ppmt(10%,3,12,-100000) = 5658.36
Average Countif
Sumif Averageif Countblank Round Int
Subtotal Sign
Product Abs Floor Ceiling Roman
Or Not
Choose Iserror Isblank Isnumber Istext
Mid Lower
Upper Proper Len Find Trim
Match Index
Row Column
Small Large
Mode Median Rank Percentile
Year Month
Day Weekday Hour Minute Second
Pmt Ipmt
Ppmt
Mod
Iferror
Dollar
Value Substitute Rept Text
Datevalue
Timevalue Networkdays
Type
Looking for More Material on Excel Formulas ? For more information on excel formulas, do visit the following links: http://chandoo.org/wp/tag/formulas http://chandoo.org/excel-formulas http://chandoo.org/wp/category/excel http://chandoo.org/wp/ If you would like to receive daily excel tips by e-mail, signup here