SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Downloaden Sie, um offline zu lesen
Useful Microsoft Excel Functions & Formulas
Theresa A Scott, MS
Department of Biostatistics
Vanderbilt University
theresa.scott@vanderbilt.edu
This document contains a series of examples that illustrate some useful functions and formulas you
can use in Microsoft Excel. It is meant to be an extension of my “Formulas & Functions in Microsoft
Excel” lecture that is available on my website (http://boistat.mc.vanderbilt.edu/TheresaScott) under
Current Teaching Material.
General Instructions:
 All of the demonstrated functions and formulas are calculated in a separate column from the
column(s) containing the cells they reference – most often the directly adjacent column.
Depending on the layout of your spreadsheet, this may require you to insert a new column
between existing columns.
 The functions and formulas are demonstrated in only a few rows. You will have to copy and
paste the function/formula down the appropriate column in your spreadsheet in order for it to
calculate the result for every desired row.
 A help file, which includes examples, can be accessed for any function by clicking the “Help on
this function” link in the Function Wizard after you’ve highlighted the function of interest.
Functions to be illustrated (listed by category):
 Date and Time:
 TODAY; NOW: returns the current date, the current date and time, respectively.
 DATE: returns the number that represents the date given in Excel date-time code.
 TIME: converts the hours, minutes, and seconds given as numbers to an Excel serial
number (formatted with a time format).
 DAY; MONTH; and YEAR: returns the day of the month (1 to 31), the month (1 to 12), and
year from a date, respectively.
 HOUR; MINUTE; and SECOND: returns the hour (0 to 23), minute (0 to 59), and second (0
to 59) from a time, respectively.
 Engineering:
 CONVERT: converts a number (or a time) from one measurement system to another.
 Information:
 COUNTBLANK: counts the number of blank cells in a specified range of cells.
 Logical:
 AND: checks whether all of the arguments are TRUE and returns TRUE only if all
arguments are TRUE (returns FALSE otherwise).
 OR: checks whether any of the arguments are TRUE and returns FALSE only if all
arguments are FALSE (returns TRUE otherwise).
 IF: checks whether a condition is met, and returns one value if TRUE, another if FALSE.
 Math:
 COUNTIF: counts the number of cells within a range that meet the given condition.
 ROUND, ROUNDDOWN, and ROUNDUP: rounds a number to a specified number of
digits, down (toward zero), and up (away from zero), respectively.
 SUMIF: adds all the cells specified by a given condition, respectively.
 Statistical:
 COUNTA: counts the number of cells that are not empty.
Page 1
 Text and Data:
 CONCATENATE: joins several text strings into one text string.
 LEFT; RIGHT: returns the first, last (respectively) character or characters in a text string,
based on the number of characters you specify.
 LEN: returns the number of characters in a text string.
 LOWER; UPPER: converts a text string to lowercase, uppercase, respectively.
 PROPER: capitalizes the first letter in a text string and any other letters in the text that
follow any character other than a letter. Converts all other letters to lowercase letters.
 SEARCH: returns the number of the character at which a specific character or text string is
first found, beginning with a specific starting number. Often used to determine the location
of a character or text string within another text string.
 TEXT: converts a value to text in a specific number format.
 TRIM: removes all the spaces from a text string except for single spaces between words.
Often used on text you have received from another application that may have irregular
spacing (ie, leading or trailing spaces).
Additional functions not illustrated but often useful (listed by category):1
 Date and Time:
 NETWORKDAYS: returns the number of whole workdays between two dates.
 WEEKDAY: returns a number (1 to 7) identifying the day of the week of a date.
 WEEKNUM: returns the week number in the year.
 WORKDAY: returns the date so many workdays before/after a given start date.
 Information:
 ISBLANK: checks whether the reference is a blank cell; returns TRUE if it is, FALSE
otherwise.
 Logical:
 TRUE; FALSE: returns the logical value TRUE; FALSE, respectively.
 NOT: reverses the logic of its argument (ie, changes TRUE to FALSE or FALSE to TRUE).
 Lookup and Reference:
 CHOOSE: chooses a value or action to perform from a list of values, depending on an
index number. Alternative to nested IF functions. Another formula is often used to return
the index number.
 Math:
 CEILING; FLOOR; EVEN; ODD; INT: rounds a number to the nearest integer or to the
nearest multiple of significance, down towards zero, up to the nearest even integer, up to
the nearest odd integer, and down to the nearest integer, respectively.
 LN; LOG; LOG10: returns the natural logarithm of a number, the logarithm of a number to
the specified base, and the base-10 logarithm of a number, respectively.
 RAND; RANDBETWEEN: returns a random number greater than or equal to 0 and less
than 1 (changes on recalculation), between the numbers you specify, respectively.
 SQRT: returns the square root of a number.
 Statistical:
 AVERAGE; MEDIAN: returns the average (arithmetic mean), median (respectively) of the
given numeric arguments.
 MIN; MAX: returns the smallest, largest number (respectively) in a set of values.
 STDEV; VAR: estimates the standard deviation, variance (respectively) of the given
numeric arguments.
1 There is additionally an extensive amount of Financial functions available – full list given in the Function Wizard.
Page 2
Examples of useful functions and formulas:
 Common Text:
 Change the case of a text string using the UPPER, LOWER, and PROPER functions.
Example spreadsheet:
A
1 Name
2 nancy Davolio
Formula Result
=UPPER(A2) NANCY DAVOLIO
=LOWER(A2) nancy davolio
=PROPER(A2) Nancy Davolio
 Remove spaces from the beginning and end of a cell with the TRIM function.
Example spreadsheet:
A
1 Data
2 BD122
3 Vitamin A
Formula Result*
=TRIM(A2) BD122
=TRIM(A3) Vitamin A
* original text strings were “ BD122 ” and “ Vitamin A”.
 Remove characters from text using the LEFT, RIGHT, and LEN functions.*
Example spreadsheet:
A
1 Data
2 Vitamin Ester-C
3 Vitamin B1
Formula Result
=LEFT(A2, LEN(A2)-8) Vitamin
=RIGHT(A3, LEN(A3)-8) B1
* Depending on the situation, can also use the Replace from the Edit drop-menu.
Page 3
 Combine first and last names with the CONCATENATE function.
Example spreadsheet:
A B
1 First Name Last Name
2 Nancy Davolio
3 Andrew Fuller
Formula Result
=A2&” “B2 Nancy Davolio
=B3&”, “A3 Fuller, Andrew
=CONCATENATE(A2, “ “, B2) Nancy Davolio
NOTE: First formula is equivalent to third.
 Extract the first or last name from a cell containing both first and last name using the LEFT,
RIGHT, and SEARCH functions.
Example spreadsheet:
A
1 Name
2 Nancy Davolio
3 Fuller, Andrew
Formula Result
=LEFT(A2, SEARCH(“ “, A2)-1) Nancy
=RIGHT(A2, LEN(2)-SEARCH(“ “, A2)) Davolio
=LEFT(A2, SEARCH(“,”, A2)-1) Fuller
=RIGHT(A2, LEN(A2)-SEARCH(“ ”, A2)) Andrew
 Common Math:
 Convert measurements using the CONVERT function (see help file for complete list).
Example spreadsheet:
A
1 Data
2 6
Formula Result
=CONVERT(A2, “C”, “F”) 42.8
=CONVERT(A2, “lbm”, “kg”) 2.721554
=CONVERT(A2, “cm”, “in”) 2.362204724
Page 4
 Round a number with the ROUND, ROUNDUP, and ROUNDDOWN functions.
Example spreadsheet:
A
1 Data
2 20.3
3 -5.9
4 12.5493
5 22230
Formula Result
=ROUND(A2, 0) 20
=ROUNDUP(A2, 0) 21
=ROUNDUP(A4, 2) 12.55
=ROUNDDOWN(A3, 0) -5
=ROUNDDOWN(A4, 2) 12.54
=ROUND(A5, -2) 22200
=ROUNDUP(A5, -3) 23000
NOTE: Use the Number tab from the Format Cells dialog box (reached via Cells from
the Format drop-menu) to only change the number of decimal places displayed
(ie, this does not change the actual number).
 Count cells with the COUNTA and COUNTBLANK functions.
Example spreadsheet:
A
1 Data
2 20.3
3
4 12.5
5 15.0
Formula Result
=COUNTA(A2:A5) 4
=COUNTBLANK(A2:A5) 1
NOTE: PivotTables are an alternative to manually calculating counts using function and
formulas – see my “PivotTable & PivotChart Reports, and Macros in Microsoft Excel”
lecture (also available on my website).
Page 5
 Conditionally count the values in cells using the COUNTIF function.
Example spreadsheet:
A B
1 Salesperson Invoice
2 Buchanan 15000
3 Buchanan 9000
4 Suyama 8000
5 Suyama 20000
6 Buchanan 5000
7 Dodsworth 22500
Formula Result
=COUNTIF(B2:B7, “>9000”) 3
=COUNTIF(B2:B7, “<=9000”) 3
=COUNTIF(A2:A7, “Buchanan”) 3
=COUNTIF(A2:A7, A4) 2
 Conditionally add numbers using the SUMIF function.
Example spreadsheet:
A B
1 Salesperson Invoice
2 Buchanan 15000
3 Buchanan 9000
4 Suyama 8000
5 Suyama 20000
6 Buchanan 5000
7 Dodsworth 22500
Formula Result
=SUMIF(A2:A7, “Buchanan”, B2:B7) 29000
=SUMIF(B2:B7, “>=9000”, B2:B7) 66500
=SUMIF(B2:B7, “<9000”, B2:B7) 13000
NOTE: The three arguments to the SUMIF function are (1) the range to evaluate (these
cells are checked to determine whether a row meets the criteria); (2) the criteria (the
condition that the cells evaluated must meet for the row to be included in the sum); and
(3) the range to sum (the numbers in these cells are added, provided the row satisfies
the condition).
Page 6
 Common Conditional:
 Conditionally evaluate the contents of a cell using the IF, AND, and OR functions:
Example spreadsheet:
A B
1 Gender Test Value
2 Female 15
3 Male 9
4 Female 8
5 Female 20
6 Male 4
7 Male 22
Formula Result
=IF(B2 > 10, “High Risk”, “Low Risk”) High Risk
=IF(AND(B2 > 10, A2 = “Female”),
“High Risk Female”, “Low Risk Male/Female”)
High Risk Female
=IF(AND(B7 > 10, A2 = “Female”),
“High Risk Female”, “Low Risk Male/Female”)
Low Risk Male/Female
=IF(B3 < 5, "<5", IF(AND(B3 >= 5, B3 <= 10),
"5-10", ">10"))
5-10
=IF(B6 < 5, "<5", IF(AND(B6 >= 5, B6 <= 10),
"5-10", ">10"))
<5
NOTE: Last two formulas are examples of nested IF functions.
 Common Date and Time:
 Insert an automatically updated date or time using the TODAY and NOW functions.
Formula Result
=TODAY() (current date; varies)
=NOW() (current date & time; varies)
 Convert times using the CONVERT and other functions.
Example spreadsheet:
A
1 Time
2 6
3 10:35 AM
4 12.25
Page 7
Formula Result
=CONVERT(A2, “day”, “hr’) 144
=CONVERT(A2, “hr”, “mn”) 360
=CONVERT(A2, “yr”, “day’) 2191.5
=(A3-INT(A3))*24 10.583333
=TEXT(A4/24, “h:mm”) 12:15
NOTE: The fourth and fifth formulas convert hours from a standard format (hours :
minutes : seconds) to a decimal number and vice versa (reference time = 12:00 AM).
 Add dates.
Example spreadsheet:
A B C D
1 Date Days to add Months to add Years to add
2 6/9/2007 3 3 3
3 9/2/2007 5 5 5
4 12/10/2008 25 1 2
Formula Result
=A2+B2 6/12/2007
=A4+B4 2/2/2009
=DATE(YEAR(A2), MONTH(A2)+B2, DAY(A2)) 9/9/2007
=DATE(YEAR(A3), MONTH(A3)+B3, DAY(A3)) 2/2/2008
=DATE(YEAR(A4)+C4, MONTH(A4), DAY(A4)) 12/10/2010
=DATE(YEAR(A2)+D2, MONTH(A2)+C2, DAY(A2)+B2) 9/12/2010
 Add times.
Example spreadsheet:
A B
1 Time Time to be added
2 10:35:00 AM 10
Formula Result
=A2 + TIME(B2, 0, 0) 08:35:00 PM
=A2 + TIME(0, B2, 0) 10:45:00 AM
=A2 + TIME(0, 0, B2) 10:35:10 AM
Page 8
 Calculate the difference between two dates.
Example spreadsheet:
A B
1 Date1 Date2
2 6/9/2007 6/15/2007
3 9/2/2007 10/8/2007
4 12/10/2008 9/19/2009
Formula Result
=A3 – A2 6
=MONTH(B3) – MONTH(B2) 1
=(YEAR(B4)-YEAR(A4))*12 + MONTH(B4) – MONTH(A4) 9
=YEAR(B4) – YEAR(A4) 1
 Calculate the difference between two times.
Example spreadsheet:
A B C
1 Start time End time 1 End time 2
2 6/9/2007 10:35 AM 6/9/2007 3:30 PM 6/10/2007 4:30 PM
Formula Result
=TEXT(B2-A2, “h”) 4
=TEXT(B2-A2, “h:mm”) 4:55
=TEXT(B2-A2, “h:mm:ss”) 4:55:00
=INT((C2-A2)*24) 29
Removing functions and formulas using “Paste Special”:
It is useful to know how to save only the calculated value of a function or formula – that is, the
function or formula that produced the value is removed. For instance, when you save an Excel file as
a delimited text file (eg, .txt or .csv) all values calculated by a function or formula are replaced with 0s.
This obviously can cause major problems. To get around this, we can copy the functions and
formulas in specific cells and then paste only their values using the “Paste Special” option from the
“Edit” drop-menu. For example,
1. Select the cell(s) you want to copy and select “Edit” > “Copy” (or press Ctrl+C).
2. Click the cell or range you want to paste the information into.
3. Right-click and choose “Paste Special” (or select “Edit” > “Paste Special”).
4. Choose “Values” and click OK.
The “Paste Special” feature also allows you to paste just the format of the cell(s) (ie, font, alignment,
etc) and to quickly switch data from columns to rows (ie, transpose the cells).
Page 9

Weitere ähnliche Inhalte

Was ist angesagt?

10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any JobHitesh Biyani
 
2. mathematical functions in excel
2. mathematical functions in excel2. mathematical functions in excel
2. mathematical functions in excelDr. Prashant Vats
 
Excel Top 10 formula For The Beginners
Excel Top 10 formula For The BeginnersExcel Top 10 formula For The Beginners
Excel Top 10 formula For The BeginnersStat Analytica
 
Using Excel Functions
Using Excel FunctionsUsing Excel Functions
Using Excel FunctionsGautam Gupta
 
Excel Tutorials - VLOOKUP and HLOOKUP Functions
Excel Tutorials - VLOOKUP and HLOOKUP FunctionsExcel Tutorials - VLOOKUP and HLOOKUP Functions
Excel Tutorials - VLOOKUP and HLOOKUP FunctionsMerve Nur Taş
 
Manual for Troubleshooting Formulas & Functions in Excel
Manual for Troubleshooting Formulas & Functions in ExcelManual for Troubleshooting Formulas & Functions in Excel
Manual for Troubleshooting Formulas & Functions in ExcelChristopher Ward
 
Using vlookup in excel
Using vlookup in excelUsing vlookup in excel
Using vlookup in excelmegankilb
 
Advanced formula
Advanced formulaAdvanced formula
Advanced formulaMaymay027
 
Working on MS-Excel 'FORMULA TAB'
Working on MS-Excel 'FORMULA TAB'Working on MS-Excel 'FORMULA TAB'
Working on MS-Excel 'FORMULA TAB'Pranav Kumar
 
VLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHVLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHMridul Bansal
 
MS-Excel Formulas and Functions
MS-Excel Formulas and FunctionsMS-Excel Formulas and Functions
MS-Excel Formulas and FunctionsP. SUNDARI ARUN
 
Formulas and functions - By Amresh Tiwari
Formulas and functions - By Amresh TiwariFormulas and functions - By Amresh Tiwari
Formulas and functions - By Amresh TiwariAmresh Tiwari
 
Excel IF function
Excel IF functionExcel IF function
Excel IF functionHtay Aung
 
Microsoft Excel VLOOKUP Function
Microsoft Excel VLOOKUP FunctionMicrosoft Excel VLOOKUP Function
Microsoft Excel VLOOKUP FunctionExcel
 
Advances in ms excel
Advances in ms excelAdvances in ms excel
Advances in ms excelMohit Kumar
 
Advanced Microsoft Excel
Advanced Microsoft ExcelAdvanced Microsoft Excel
Advanced Microsoft ExcelEric Metelka
 

Was ist angesagt? (20)

Excel formula
Excel formulaExcel formula
Excel formula
 
stats
statsstats
stats
 
10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job
 
2. mathematical functions in excel
2. mathematical functions in excel2. mathematical functions in excel
2. mathematical functions in excel
 
Excel Top 10 formula For The Beginners
Excel Top 10 formula For The BeginnersExcel Top 10 formula For The Beginners
Excel Top 10 formula For The Beginners
 
Mastering Excel Formulas and Functions
Mastering Excel Formulas and FunctionsMastering Excel Formulas and Functions
Mastering Excel Formulas and Functions
 
Using Excel Functions
Using Excel FunctionsUsing Excel Functions
Using Excel Functions
 
Excel Tutorials - VLOOKUP and HLOOKUP Functions
Excel Tutorials - VLOOKUP and HLOOKUP FunctionsExcel Tutorials - VLOOKUP and HLOOKUP Functions
Excel Tutorials - VLOOKUP and HLOOKUP Functions
 
Manual for Troubleshooting Formulas & Functions in Excel
Manual for Troubleshooting Formulas & Functions in ExcelManual for Troubleshooting Formulas & Functions in Excel
Manual for Troubleshooting Formulas & Functions in Excel
 
Lab 4 excel basics
Lab 4 excel basicsLab 4 excel basics
Lab 4 excel basics
 
Using vlookup in excel
Using vlookup in excelUsing vlookup in excel
Using vlookup in excel
 
Advanced formula
Advanced formulaAdvanced formula
Advanced formula
 
Working on MS-Excel 'FORMULA TAB'
Working on MS-Excel 'FORMULA TAB'Working on MS-Excel 'FORMULA TAB'
Working on MS-Excel 'FORMULA TAB'
 
VLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHVLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCH
 
MS-Excel Formulas and Functions
MS-Excel Formulas and FunctionsMS-Excel Formulas and Functions
MS-Excel Formulas and Functions
 
Formulas and functions - By Amresh Tiwari
Formulas and functions - By Amresh TiwariFormulas and functions - By Amresh Tiwari
Formulas and functions - By Amresh Tiwari
 
Excel IF function
Excel IF functionExcel IF function
Excel IF function
 
Microsoft Excel VLOOKUP Function
Microsoft Excel VLOOKUP FunctionMicrosoft Excel VLOOKUP Function
Microsoft Excel VLOOKUP Function
 
Advances in ms excel
Advances in ms excelAdvances in ms excel
Advances in ms excel
 
Advanced Microsoft Excel
Advanced Microsoft ExcelAdvanced Microsoft Excel
Advanced Microsoft Excel
 

Andere mochten auch

Excel Formulas Functions 2007
Excel Formulas Functions 2007Excel Formulas Functions 2007
Excel Formulas Functions 2007simply_coool
 
Excel 2007-functions-formulas
Excel 2007-functions-formulasExcel 2007-functions-formulas
Excel 2007-functions-formulasSankar Natarajan
 
Excel formulas-manual
Excel formulas-manualExcel formulas-manual
Excel formulas-manualsrv1972
 
Excel Formula and Function Basics
Excel Formula and Function BasicsExcel Formula and Function Basics
Excel Formula and Function Basicsguest1c3d8c6
 
Excel advanced formulas and functions i-school tutorials
Excel  advanced formulas and functions   i-school tutorialsExcel  advanced formulas and functions   i-school tutorials
Excel advanced formulas and functions i-school tutorialstechie_govind
 
FEATURES OF MICROSOFT EXCEL
FEATURES OF MICROSOFT EXCELFEATURES OF MICROSOFT EXCEL
FEATURES OF MICROSOFT EXCELpawa9pawa
 

Andere mochten auch (6)

Excel Formulas Functions 2007
Excel Formulas Functions 2007Excel Formulas Functions 2007
Excel Formulas Functions 2007
 
Excel 2007-functions-formulas
Excel 2007-functions-formulasExcel 2007-functions-formulas
Excel 2007-functions-formulas
 
Excel formulas-manual
Excel formulas-manualExcel formulas-manual
Excel formulas-manual
 
Excel Formula and Function Basics
Excel Formula and Function BasicsExcel Formula and Function Basics
Excel Formula and Function Basics
 
Excel advanced formulas and functions i-school tutorials
Excel  advanced formulas and functions   i-school tutorialsExcel  advanced formulas and functions   i-school tutorials
Excel advanced formulas and functions i-school tutorials
 
FEATURES OF MICROSOFT EXCEL
FEATURES OF MICROSOFT EXCELFEATURES OF MICROSOFT EXCEL
FEATURES OF MICROSOFT EXCEL
 

Ähnlich wie Excel.useful fns

Chapter 16-spreadsheet1 questions and answer
Chapter 16-spreadsheet1  questions and answerChapter 16-spreadsheet1  questions and answer
Chapter 16-spreadsheet1 questions and answerRaajTech
 
cheatsheet from DataCamp.pdf
cheatsheet from DataCamp.pdfcheatsheet from DataCamp.pdf
cheatsheet from DataCamp.pdfRakesh Nimhan
 
Ms excel commands
Ms excel commandsMs excel commands
Ms excel commandsDiyaVerma14
 
1.2 Zep Excel.pptx
1.2 Zep Excel.pptx1.2 Zep Excel.pptx
1.2 Zep Excel.pptxPizzaM
 
MIS 226: Chapter 2
MIS 226: Chapter 2MIS 226: Chapter 2
MIS 226: Chapter 2macrob14
 
3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.pptAllanGuevarra1
 
3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.pptJosephIThomas
 
Introduction to micro soft Training ms Excel.ppt
Introduction to micro soft Training ms Excel.pptIntroduction to micro soft Training ms Excel.ppt
Introduction to micro soft Training ms Excel.pptdejene3
 
Excel Functions
Excel Functions Excel Functions
Excel Functions BHARAT JHA
 
Useful Excel Functions & Formula Used everywhere.pptx
Useful Excel Functions & Formula Used everywhere.pptxUseful Excel Functions & Formula Used everywhere.pptx
Useful Excel Functions & Formula Used everywhere.pptxvanshikatyagi74
 
Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2Techglyphs
 
Structured query language(sql)
Structured query language(sql)Structured query language(sql)
Structured query language(sql)Huda Alameen
 
Statistics is both the science of uncertainty and the technology.docx
Statistics is both the science of uncertainty and the technology.docxStatistics is both the science of uncertainty and the technology.docx
Statistics is both the science of uncertainty and the technology.docxrafaelaj1
 
Excel Overview.pptx
Excel Overview.pptxExcel Overview.pptx
Excel Overview.pptxNewmanLeke
 
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdfNitish Nagar
 
MIRCROSOFT EXCEL- brief and useful for beginners by RISHABH BANSAL
MIRCROSOFT EXCEL- brief and useful for beginners by RISHABH BANSALMIRCROSOFT EXCEL- brief and useful for beginners by RISHABH BANSAL
MIRCROSOFT EXCEL- brief and useful for beginners by RISHABH BANSALRishabh Bansal
 
Top 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must knowTop 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must knowAlexHenderson59
 

Ähnlich wie Excel.useful fns (20)

Chapter 16-spreadsheet1 questions and answer
Chapter 16-spreadsheet1  questions and answerChapter 16-spreadsheet1  questions and answer
Chapter 16-spreadsheet1 questions and answer
 
cheatsheet from DataCamp.pdf
cheatsheet from DataCamp.pdfcheatsheet from DataCamp.pdf
cheatsheet from DataCamp.pdf
 
Ms excel commands
Ms excel commandsMs excel commands
Ms excel commands
 
1.2 Zep Excel.pptx
1.2 Zep Excel.pptx1.2 Zep Excel.pptx
1.2 Zep Excel.pptx
 
MIS 226: Chapter 2
MIS 226: Chapter 2MIS 226: Chapter 2
MIS 226: Chapter 2
 
3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt
 
3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt
 
Introduction to micro soft Training ms Excel.ppt
Introduction to micro soft Training ms Excel.pptIntroduction to micro soft Training ms Excel.ppt
Introduction to micro soft Training ms Excel.ppt
 
Excel Training
Excel TrainingExcel Training
Excel Training
 
Excel Functions
Excel Functions Excel Functions
Excel Functions
 
Useful Excel Functions & Formula Used everywhere.pptx
Useful Excel Functions & Formula Used everywhere.pptxUseful Excel Functions & Formula Used everywhere.pptx
Useful Excel Functions & Formula Used everywhere.pptx
 
Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2
 
Structured query language(sql)
Structured query language(sql)Structured query language(sql)
Structured query language(sql)
 
Statistics is both the science of uncertainty and the technology.docx
Statistics is both the science of uncertainty and the technology.docxStatistics is both the science of uncertainty and the technology.docx
Statistics is both the science of uncertainty and the technology.docx
 
Excel Overview.pptx
Excel Overview.pptxExcel Overview.pptx
Excel Overview.pptx
 
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
 
MIRCROSOFT EXCEL- brief and useful for beginners by RISHABH BANSAL
MIRCROSOFT EXCEL- brief and useful for beginners by RISHABH BANSALMIRCROSOFT EXCEL- brief and useful for beginners by RISHABH BANSAL
MIRCROSOFT EXCEL- brief and useful for beginners by RISHABH BANSAL
 
Advanced Excel ppt
Advanced Excel pptAdvanced Excel ppt
Advanced Excel ppt
 
Top 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must knowTop 20 microsoft excel formulas you must know
Top 20 microsoft excel formulas you must know
 
Ba accounting skills lecture 1
Ba accounting skills lecture 1Ba accounting skills lecture 1
Ba accounting skills lecture 1
 

Excel.useful fns

  • 1. Useful Microsoft Excel Functions & Formulas Theresa A Scott, MS Department of Biostatistics Vanderbilt University theresa.scott@vanderbilt.edu This document contains a series of examples that illustrate some useful functions and formulas you can use in Microsoft Excel. It is meant to be an extension of my “Formulas & Functions in Microsoft Excel” lecture that is available on my website (http://boistat.mc.vanderbilt.edu/TheresaScott) under Current Teaching Material. General Instructions:  All of the demonstrated functions and formulas are calculated in a separate column from the column(s) containing the cells they reference – most often the directly adjacent column. Depending on the layout of your spreadsheet, this may require you to insert a new column between existing columns.  The functions and formulas are demonstrated in only a few rows. You will have to copy and paste the function/formula down the appropriate column in your spreadsheet in order for it to calculate the result for every desired row.  A help file, which includes examples, can be accessed for any function by clicking the “Help on this function” link in the Function Wizard after you’ve highlighted the function of interest. Functions to be illustrated (listed by category):  Date and Time:  TODAY; NOW: returns the current date, the current date and time, respectively.  DATE: returns the number that represents the date given in Excel date-time code.  TIME: converts the hours, minutes, and seconds given as numbers to an Excel serial number (formatted with a time format).  DAY; MONTH; and YEAR: returns the day of the month (1 to 31), the month (1 to 12), and year from a date, respectively.  HOUR; MINUTE; and SECOND: returns the hour (0 to 23), minute (0 to 59), and second (0 to 59) from a time, respectively.  Engineering:  CONVERT: converts a number (or a time) from one measurement system to another.  Information:  COUNTBLANK: counts the number of blank cells in a specified range of cells.  Logical:  AND: checks whether all of the arguments are TRUE and returns TRUE only if all arguments are TRUE (returns FALSE otherwise).  OR: checks whether any of the arguments are TRUE and returns FALSE only if all arguments are FALSE (returns TRUE otherwise).  IF: checks whether a condition is met, and returns one value if TRUE, another if FALSE.  Math:  COUNTIF: counts the number of cells within a range that meet the given condition.  ROUND, ROUNDDOWN, and ROUNDUP: rounds a number to a specified number of digits, down (toward zero), and up (away from zero), respectively.  SUMIF: adds all the cells specified by a given condition, respectively.  Statistical:  COUNTA: counts the number of cells that are not empty. Page 1
  • 2.  Text and Data:  CONCATENATE: joins several text strings into one text string.  LEFT; RIGHT: returns the first, last (respectively) character or characters in a text string, based on the number of characters you specify.  LEN: returns the number of characters in a text string.  LOWER; UPPER: converts a text string to lowercase, uppercase, respectively.  PROPER: capitalizes the first letter in a text string and any other letters in the text that follow any character other than a letter. Converts all other letters to lowercase letters.  SEARCH: returns the number of the character at which a specific character or text string is first found, beginning with a specific starting number. Often used to determine the location of a character or text string within another text string.  TEXT: converts a value to text in a specific number format.  TRIM: removes all the spaces from a text string except for single spaces between words. Often used on text you have received from another application that may have irregular spacing (ie, leading or trailing spaces). Additional functions not illustrated but often useful (listed by category):1  Date and Time:  NETWORKDAYS: returns the number of whole workdays between two dates.  WEEKDAY: returns a number (1 to 7) identifying the day of the week of a date.  WEEKNUM: returns the week number in the year.  WORKDAY: returns the date so many workdays before/after a given start date.  Information:  ISBLANK: checks whether the reference is a blank cell; returns TRUE if it is, FALSE otherwise.  Logical:  TRUE; FALSE: returns the logical value TRUE; FALSE, respectively.  NOT: reverses the logic of its argument (ie, changes TRUE to FALSE or FALSE to TRUE).  Lookup and Reference:  CHOOSE: chooses a value or action to perform from a list of values, depending on an index number. Alternative to nested IF functions. Another formula is often used to return the index number.  Math:  CEILING; FLOOR; EVEN; ODD; INT: rounds a number to the nearest integer or to the nearest multiple of significance, down towards zero, up to the nearest even integer, up to the nearest odd integer, and down to the nearest integer, respectively.  LN; LOG; LOG10: returns the natural logarithm of a number, the logarithm of a number to the specified base, and the base-10 logarithm of a number, respectively.  RAND; RANDBETWEEN: returns a random number greater than or equal to 0 and less than 1 (changes on recalculation), between the numbers you specify, respectively.  SQRT: returns the square root of a number.  Statistical:  AVERAGE; MEDIAN: returns the average (arithmetic mean), median (respectively) of the given numeric arguments.  MIN; MAX: returns the smallest, largest number (respectively) in a set of values.  STDEV; VAR: estimates the standard deviation, variance (respectively) of the given numeric arguments. 1 There is additionally an extensive amount of Financial functions available – full list given in the Function Wizard. Page 2
  • 3. Examples of useful functions and formulas:  Common Text:  Change the case of a text string using the UPPER, LOWER, and PROPER functions. Example spreadsheet: A 1 Name 2 nancy Davolio Formula Result =UPPER(A2) NANCY DAVOLIO =LOWER(A2) nancy davolio =PROPER(A2) Nancy Davolio  Remove spaces from the beginning and end of a cell with the TRIM function. Example spreadsheet: A 1 Data 2 BD122 3 Vitamin A Formula Result* =TRIM(A2) BD122 =TRIM(A3) Vitamin A * original text strings were “ BD122 ” and “ Vitamin A”.  Remove characters from text using the LEFT, RIGHT, and LEN functions.* Example spreadsheet: A 1 Data 2 Vitamin Ester-C 3 Vitamin B1 Formula Result =LEFT(A2, LEN(A2)-8) Vitamin =RIGHT(A3, LEN(A3)-8) B1 * Depending on the situation, can also use the Replace from the Edit drop-menu. Page 3
  • 4.  Combine first and last names with the CONCATENATE function. Example spreadsheet: A B 1 First Name Last Name 2 Nancy Davolio 3 Andrew Fuller Formula Result =A2&” “B2 Nancy Davolio =B3&”, “A3 Fuller, Andrew =CONCATENATE(A2, “ “, B2) Nancy Davolio NOTE: First formula is equivalent to third.  Extract the first or last name from a cell containing both first and last name using the LEFT, RIGHT, and SEARCH functions. Example spreadsheet: A 1 Name 2 Nancy Davolio 3 Fuller, Andrew Formula Result =LEFT(A2, SEARCH(“ “, A2)-1) Nancy =RIGHT(A2, LEN(2)-SEARCH(“ “, A2)) Davolio =LEFT(A2, SEARCH(“,”, A2)-1) Fuller =RIGHT(A2, LEN(A2)-SEARCH(“ ”, A2)) Andrew  Common Math:  Convert measurements using the CONVERT function (see help file for complete list). Example spreadsheet: A 1 Data 2 6 Formula Result =CONVERT(A2, “C”, “F”) 42.8 =CONVERT(A2, “lbm”, “kg”) 2.721554 =CONVERT(A2, “cm”, “in”) 2.362204724 Page 4
  • 5.  Round a number with the ROUND, ROUNDUP, and ROUNDDOWN functions. Example spreadsheet: A 1 Data 2 20.3 3 -5.9 4 12.5493 5 22230 Formula Result =ROUND(A2, 0) 20 =ROUNDUP(A2, 0) 21 =ROUNDUP(A4, 2) 12.55 =ROUNDDOWN(A3, 0) -5 =ROUNDDOWN(A4, 2) 12.54 =ROUND(A5, -2) 22200 =ROUNDUP(A5, -3) 23000 NOTE: Use the Number tab from the Format Cells dialog box (reached via Cells from the Format drop-menu) to only change the number of decimal places displayed (ie, this does not change the actual number).  Count cells with the COUNTA and COUNTBLANK functions. Example spreadsheet: A 1 Data 2 20.3 3 4 12.5 5 15.0 Formula Result =COUNTA(A2:A5) 4 =COUNTBLANK(A2:A5) 1 NOTE: PivotTables are an alternative to manually calculating counts using function and formulas – see my “PivotTable & PivotChart Reports, and Macros in Microsoft Excel” lecture (also available on my website). Page 5
  • 6.  Conditionally count the values in cells using the COUNTIF function. Example spreadsheet: A B 1 Salesperson Invoice 2 Buchanan 15000 3 Buchanan 9000 4 Suyama 8000 5 Suyama 20000 6 Buchanan 5000 7 Dodsworth 22500 Formula Result =COUNTIF(B2:B7, “>9000”) 3 =COUNTIF(B2:B7, “<=9000”) 3 =COUNTIF(A2:A7, “Buchanan”) 3 =COUNTIF(A2:A7, A4) 2  Conditionally add numbers using the SUMIF function. Example spreadsheet: A B 1 Salesperson Invoice 2 Buchanan 15000 3 Buchanan 9000 4 Suyama 8000 5 Suyama 20000 6 Buchanan 5000 7 Dodsworth 22500 Formula Result =SUMIF(A2:A7, “Buchanan”, B2:B7) 29000 =SUMIF(B2:B7, “>=9000”, B2:B7) 66500 =SUMIF(B2:B7, “<9000”, B2:B7) 13000 NOTE: The three arguments to the SUMIF function are (1) the range to evaluate (these cells are checked to determine whether a row meets the criteria); (2) the criteria (the condition that the cells evaluated must meet for the row to be included in the sum); and (3) the range to sum (the numbers in these cells are added, provided the row satisfies the condition). Page 6
  • 7.  Common Conditional:  Conditionally evaluate the contents of a cell using the IF, AND, and OR functions: Example spreadsheet: A B 1 Gender Test Value 2 Female 15 3 Male 9 4 Female 8 5 Female 20 6 Male 4 7 Male 22 Formula Result =IF(B2 > 10, “High Risk”, “Low Risk”) High Risk =IF(AND(B2 > 10, A2 = “Female”), “High Risk Female”, “Low Risk Male/Female”) High Risk Female =IF(AND(B7 > 10, A2 = “Female”), “High Risk Female”, “Low Risk Male/Female”) Low Risk Male/Female =IF(B3 < 5, "<5", IF(AND(B3 >= 5, B3 <= 10), "5-10", ">10")) 5-10 =IF(B6 < 5, "<5", IF(AND(B6 >= 5, B6 <= 10), "5-10", ">10")) <5 NOTE: Last two formulas are examples of nested IF functions.  Common Date and Time:  Insert an automatically updated date or time using the TODAY and NOW functions. Formula Result =TODAY() (current date; varies) =NOW() (current date & time; varies)  Convert times using the CONVERT and other functions. Example spreadsheet: A 1 Time 2 6 3 10:35 AM 4 12.25 Page 7
  • 8. Formula Result =CONVERT(A2, “day”, “hr’) 144 =CONVERT(A2, “hr”, “mn”) 360 =CONVERT(A2, “yr”, “day’) 2191.5 =(A3-INT(A3))*24 10.583333 =TEXT(A4/24, “h:mm”) 12:15 NOTE: The fourth and fifth formulas convert hours from a standard format (hours : minutes : seconds) to a decimal number and vice versa (reference time = 12:00 AM).  Add dates. Example spreadsheet: A B C D 1 Date Days to add Months to add Years to add 2 6/9/2007 3 3 3 3 9/2/2007 5 5 5 4 12/10/2008 25 1 2 Formula Result =A2+B2 6/12/2007 =A4+B4 2/2/2009 =DATE(YEAR(A2), MONTH(A2)+B2, DAY(A2)) 9/9/2007 =DATE(YEAR(A3), MONTH(A3)+B3, DAY(A3)) 2/2/2008 =DATE(YEAR(A4)+C4, MONTH(A4), DAY(A4)) 12/10/2010 =DATE(YEAR(A2)+D2, MONTH(A2)+C2, DAY(A2)+B2) 9/12/2010  Add times. Example spreadsheet: A B 1 Time Time to be added 2 10:35:00 AM 10 Formula Result =A2 + TIME(B2, 0, 0) 08:35:00 PM =A2 + TIME(0, B2, 0) 10:45:00 AM =A2 + TIME(0, 0, B2) 10:35:10 AM Page 8
  • 9.  Calculate the difference between two dates. Example spreadsheet: A B 1 Date1 Date2 2 6/9/2007 6/15/2007 3 9/2/2007 10/8/2007 4 12/10/2008 9/19/2009 Formula Result =A3 – A2 6 =MONTH(B3) – MONTH(B2) 1 =(YEAR(B4)-YEAR(A4))*12 + MONTH(B4) – MONTH(A4) 9 =YEAR(B4) – YEAR(A4) 1  Calculate the difference between two times. Example spreadsheet: A B C 1 Start time End time 1 End time 2 2 6/9/2007 10:35 AM 6/9/2007 3:30 PM 6/10/2007 4:30 PM Formula Result =TEXT(B2-A2, “h”) 4 =TEXT(B2-A2, “h:mm”) 4:55 =TEXT(B2-A2, “h:mm:ss”) 4:55:00 =INT((C2-A2)*24) 29 Removing functions and formulas using “Paste Special”: It is useful to know how to save only the calculated value of a function or formula – that is, the function or formula that produced the value is removed. For instance, when you save an Excel file as a delimited text file (eg, .txt or .csv) all values calculated by a function or formula are replaced with 0s. This obviously can cause major problems. To get around this, we can copy the functions and formulas in specific cells and then paste only their values using the “Paste Special” option from the “Edit” drop-menu. For example, 1. Select the cell(s) you want to copy and select “Edit” > “Copy” (or press Ctrl+C). 2. Click the cell or range you want to paste the information into. 3. Right-click and choose “Paste Special” (or select “Edit” > “Paste Special”). 4. Choose “Values” and click OK. The “Paste Special” feature also allows you to paste just the format of the cell(s) (ie, font, alignment, etc) and to quickly switch data from columns to rows (ie, transpose the cells). Page 9