Download - Useful Excel Functions (Autosaved)

Transcript
  • 7/27/2019 Useful Excel Functions (Autosaved)

    1/31

    INT

    What Does It Do ?

    This function rounds a number down to the nearest whole number.

    Syntax

    =INT(Number)

    Example

    Table 1 calculates the age of four people but the decimal points are unsightly

    Table 1Birth Date Today's Date Age1-Jan-80 6-Jul-07 27.50992

    5-Feb-81 6-Jul-07 26.4120520-Oct-79 6-Jul-07 27.709791-Nov-81 6-Jul-07 25.67556

    Table 2 shows the same calculation formatted to zero decimalsThe issue is that certain ages are rounded up, giving us incorrect ages

    Table 2Birth Date Term Start Age

    1-Jan-80 6-Jul-07 285-Feb-81 6-Jul-07 2620-Oct-79 6-Jul-07 281-Mar-81 6-Jul-07 26

    Table 3 shows the age calculation with the INT function

    Table 3Birth Date Term Start Age

    1-Jan-80 6-Jul-07 27 25.55-Feb-81 6-Jul-07 26 25.620-Oct-79 6-Jul-07 271-Mar-81 6-Jul-07 26

  • 7/27/2019 Useful Excel Functions (Autosaved)

    2/31

    ROUND

    Number

    Places ToRound

    RoundedNumber

    1.47589 0 11.47589 1 1.5

    1.47589 2 1.48

    What Does It Do ?

    This function rounds a number to a specified amount 0f decimal places.If 0 is used the number is rounded to the nearest whole number.

    Syntax

    =ROUND(NumberToRound,DecimalPlacesToUse)

    ROUNDDOWN

    NumberPlaces To

    RoundRounded

    Down

    1.47589 0 11.47589 1 1.41.47589 2 1.47

    13643.48 -1 1364013643.48 -2 1360013643.48 -3 13000

    What Does It Do ?

    This function rounds a number down to a specified amount of decimal places.

    Syntax=ROUNDDOWN(NumberToRound,DecimalPlacesToUse)

    ROUNDUP

    Number

    Places ToRound

    RoundedUp

    1.47589 0 21.47589 1 1.51.47589 2 1.48

    13643.48 -1 1365013643.48 -2 1370013643.48 -3 14000

    What Does It Do ?

    This function rounds a number up to a specified amount of decimal places.

    Syntax

    =ROUNDUPNumberToRound,DecimalPlacesToUse)

  • 7/27/2019 Useful Excel Functions (Autosaved)

    3/31

    IF

    What Does It Do?

    This function tests a condition.If the condition is met it is considered to be TRUE.If the condition is not met it is considered as FALSE.Depending upon the result, one of two actions will be carried out.

    Syntax

    =IF(Condition,ActionIfTrue,ActionIfFalse)The Condition is usually a test of two cells, such as A1=A2.The ActionIfTrue and ActionIfFalse can be numbers, text or calculations.

    Example 1

    The following table shows the Sales figures and Targets.

    The =IF() function is used to compare the Sales with the Target.If the Sales are greater than or equal to the Target the result of Achieved is shown.If the Sales do not reach the target the result of Not Achieved is shown.Note that the text used in the =IF() function needs to be placed in double quotes "Achieved".

    Name Sales Target ResultRep 1 1000 5000 Not AchievedRep 1 6000 5000 AchievedRep 1 2600 2500 Achieved

    Rep 1 2000 4000 Not Achieved

    Example 2

    The following table is similar to that in Example 1.This time the Commission to be paid to the sales rep is calculated.If the Sales are greater than or equal to the Target, the Commission is 10% of Sales.If the Sales do not reach Target, the Commission is only 5% of Sales.

    Name Sales Target % of Target Achieved CommissionRep 1 1000 5000 -80% No CommisionRep 1 6000 5000 20% 900Rep 1 2600 2500 4% 260Rep 1 2000 4000 -50% No Commision

  • 7/27/2019 Useful Excel Functions (Autosaved)

    4/31

  • 7/27/2019 Useful Excel Functions (Autosaved)

    5/31

    AND

    What Does It Do?

    This function tests two or more conditions to see if they are all true.It can be used to test that a series of numbers meet certain conditions.It can be used to test that a number or a date falls between an upper and lower limit.Normally the AND() function would be used in conjunction with a function such as =IF().

    Syntax

    =AND(Test1,Test2)Note that there can be up to 30 possible tests.

    Example 1

    The following example shows a list of people and their hair/eye colorCan you find the person with your Hair and Eye Color?

    Name Hair Eyes Brown Hair and Blue EyesAllen Blonde Blue FALSEBob Red Brown FALSE

    Carol Blonde Brown FALSEDavid Brown Blue TRUEEric Red Blue FALSEFred Black Brown FALSEGail Red Blue FALSE

    Harry Blonde Blue FALSEIan Black Blue FALSE

    Janice Black Blue FALSEMark Brown Brown FALSEMike Brown Blue TRUE

    Name Hair Eyes Brown Hair and Blue EyesAllen Blonde Blue No MatchBob Red Brown No Match

    Carol Blonde Brown No MatchDavid Brown Blue MatchEric Red Blue No MatchFred Black Brown No MatchGail Red Blue No Match

    Harry Blonde Blue No MatchIan Black Blue No Match

    Janice Black Blue No MatchMark Brown Brown No MatchMike Brown Blue Match

  • 7/27/2019 Useful Excel Functions (Autosaved)

    6/31

  • 7/27/2019 Useful Excel Functions (Autosaved)

    7/31

    OR

    What Does It Do?

    This function tests two or more conditions to see if any of them are true.It can be used to test that at least one of a series of numbers meets certain conditNormally the OR() function would be used in conjunction with a function such as =

    Syntax=OR(Test1,Test2)Note that there can be up to 30 possible tests.

    Example

    The following example shows a list of people and their hair/eye color

    Name Hair Eyes Red Hair or Brown Hair

    Allen Blonde Blue FALSEBob Red Brown TRUE

    Carol Blonde Brown FALSE

    David Brown Blue FALSEEric Red Blue TRUEFred Black Brown TRUEGail Red Blue TRUE

    Harry Blonde Blue FALSE

    Ian Black Blue TRUEJanice Black Blue TRUEMark Brown Brown FALSEMike Brown Blue FALSE

  • 7/27/2019 Useful Excel Functions (Autosaved)

    8/31

    ions.IF().

  • 7/27/2019 Useful Excel Functions (Autosaved)

    9/31

    LEFT

    What Does It Do ?

    This function displays a specified number of characters from the left hand side of apiece of text.

    Syntax=LEFT(OriginalText,NumberOfCharactersRequired)

    Example

    Convert these 9 digit postal codes into 5 digit postal codes.

    Zip Zip70056-2343 70056

    75023-5774 7502355403-9986 5540390210-8867 90210

  • 7/27/2019 Useful Excel Functions (Autosaved)

    10/31

    RIGHT

    What Does It Do ?

    This function displays a specified number of characters from the right hand side of apiece of text.

    Syntax

    =RIGHT(OriginalText,NumberOfCharactersRequired)

    Example

    Extract the phone number without the area code

    Phone Phone(214)887-7765 887-7765(703)654-2180 654-2180

    (504)887-7767 887-7767(514)887-7768 887-7768

  • 7/27/2019 Useful Excel Functions (Autosaved)

    11/31

  • 7/27/2019 Useful Excel Functions (Autosaved)

    12/31

    MID

    What Does It Do ?

    This function picks out a piece of text from the middle of a text entry.The function needs to know at what point it should start, and how many characters to pick.If the number of characters to pick exceeds what is available, only the available characterswill be picked.

    Syntax

    =MID(OriginalText,PositionToStartPicking,NumberOfCharactersToPick)

    Example

    Convert these phone numbers into the correct format (xxx)xxx-xxxx.

    Job Code Job Level2901105 14351006 12214001 4

    5542075 24431443 11113543 3

  • 7/27/2019 Useful Excel Functions (Autosaved)

    13/31

  • 7/27/2019 Useful Excel Functions (Autosaved)

    14/31

    UPPER LOWER

    What Does It Do ?

    These functions change the case of a given text string

    Syntax

    =UPPER(Cell Reference or Text)

    =LOWER(Cell Reference or Text)=PROPER(Cell Reference or Text)

    Example

    Name Upper Case Lower CaseMiKe's CoFFee MIKE'S COFFEE mike's coffee

  • 7/27/2019 Useful Excel Functions (Autosaved)

    15/31

    PROPER

    Proper CaseMike'S Coffee

  • 7/27/2019 Useful Excel Functions (Autosaved)

    16/31

    TRIM

    What Does It Do ?

    This function removes unwanted spaces from a piece of text.The spaces before and after the text will be removed completely.Multiple spaces within the text will be trimmed to a single space

    Syntax=TRIM(TextToTrim)

    Example

    Original Text Trimmed Text ABCD ABCD

    A B C D A B C D Alan Jones Alan JonesABCD ABCD

  • 7/27/2019 Useful Excel Functions (Autosaved)

    17/31

    COUNT

    What Does It Do ?

    This function counts the number of numeric entries in a list.It will ignore blanks, text and errors.

    Syntax

    =COUNT(Range1,Range2,Range3... through to Range30)

    Example

    Item Jan Feb Mar Bricks 1000

    Wood 5000Glass 2000 1000Metal 1000Count 3 2 0

  • 7/27/2019 Useful Excel Functions (Autosaved)

    18/31

    COUNTA

    What Does It Do ?

    This function counts the number of numeric or text entries in a list.It will ignore blanks.

    Syntax

    =COUNTA(Range1,Range2,Range3... through to Range30)

    Example

    The =COUNTA() function has been used because of its ability to count text and numeric entries.

    Maths English Art History

    Alan Fail 1Bob 2 1 3

    Carol 1 1 1David Fail FailElaine 1 3 2 Fail

    How many students passed each exam.

    Math English Art History4 3 5 2

    Exams TakenBy Each Student

    423

    32

  • 7/27/2019 Useful Excel Functions (Autosaved)

    19/31

    COUNTBLANK

    What Does It Do ?

    This function counts the number of blank cells in a range.

    Syntax

    =COUNTBLANK(RangeToTest)

    Example

    Admin Accounts Production PersonnelFactory 1 Y NFactory 2 Y Y NFactory 3Factory 4 N N N

    Factory 5 Y YFactory 6 Y Y Y NFactory 7 N YFactory 8 N N Y Y

    Factory 9 YFactory 10 Y N Y

    16Departments with no Surveys

  • 7/27/2019 Useful Excel Functions (Autosaved)

    20/31

    Departments Surveyed2141

    2020

    31

  • 7/27/2019 Useful Excel Functions (Autosaved)

    21/31

    COUNTIF

    What Does It Do ?

    This function counts the number of items which match criteria set by the user.

    Syntax

    =COUNTIF(RangeOfThingsToBeCounted,CriteriaToBeMatched)

    The criteria can be typed in any of the following ways.To match a specific number type the number, such as =COUNTIF(A1:A5,100)To match a piece of text type the text in quotes, such as =COUNTIF(A1:A5,"Hello")To match using operators surround the expression with quotes, such as =COUNTIF(A1:A5,">100"

    Example

    Count If

    Employee Weekday Production 4 Entries for MondayRedd Mon 200 16 Entries Not equal to MondayYellow Mon 251 5 Count number of entries for Mr. BlackBlack Mon 240 6 Less than 200

    Whyte Mon 175 11 Counts numbers greater than the averageRedd Tue 255 2 Counts numbers equal to 255Yellow Tue 180Black Tue 230Whyte Tue 195

    Redd Wed 202Yellow Wed 215Black Wed 176Whyte Wed 199Redd Thur 150Yellow Thur 200Black Thur 220Whyte Thur 230Redd Fri 240Yellow Fri 260

    Black Fri 245Whyte Fri 255

  • 7/27/2019 Useful Excel Functions (Autosaved)

    22/31

    )

  • 7/27/2019 Useful Excel Functions (Autosaved)

    23/31

    COUNTIFS

    What Does It Do ?

    This function counts the number of cells within a range that meet multiple criteria.

    Syntax

    =COUNTIFS(RangeToTest, CriteriaToBeMatched)

    Example

    Admin AccountsFactory 1 Y NFactory 2 YFactory 3Factory 4 N

    Factory 5 YFactory 6 Y YFactory 7 NFactory 8 N N

    Factory 9Factory 10 Y N

    How many departments in Factory 6 said yes. 3

    How many departments said yes in both Factory 6 and 8. 1

    How many departments said no in Factory 6, 8, and 10 0

  • 7/27/2019 Useful Excel Functions (Autosaved)

    24/31

    Production Personnel

    Y N

    N N

    YY NYY Y

    YY

  • 7/27/2019 Useful Excel Functions (Autosaved)

    25/31

    VLOOKUP

    What Does It Do ?

    This function scans down the row headings at the side of a table to find a specified item.When the item is found, it then scans across to pick a cell entry.

    Syntax

    =VLOOKUP(ItemToFind,RangeToLookIn,ColumnToPickFrom,SortedOrUnsorted)The ItemToFind is a single item specified by the user.The RangeToLookIn is the range of data with the row headings at the left hand side.The ColumnToPickFrom is how far across the table the function should look to pick from.The Sorted/Unsorted is whether the column headings are sorted. TRUE for yes, FALSE for no.

    Example 1

    Match products with price in order to calculate the Total Amount

    Invoice Date Product_Number Product_Description37988 16000 Facility Maintenance and Repair 37988 30300 Fleet Maintenance

    37988 70700 Predictive Maintenance/Preventative Maintenance37988 87000 Landscaping/Grounds Care37990 16000 Facility Maintenance and Repair 37990 30300 Fleet Maintenance37991 16000 Facility Maintenance and Repair 37991 30300 Fleet Maintenance37991 70700 Predictive Maintenance/Preventative Maintenance37991 81150 Cleaning & Housekeeping Services37991 87000 Landscaping/Grounds Care37991 90830 Green Plants and Foliage Care

    37992 16000 Facility Maintenance and Repair 37992 30300 Fleet Maintenance

    37992 70700 Predictive Maintenance/Preventative Maintenance37992 81150 Cleaning & Housekeeping Services37992 87000 Landscaping/Grounds Care37992 90830 Green Plants and Foliage Care37993 16000 Facility Maintenance and Repair 37993 30300 Fleet Maintenance37993 70700 Predictive Maintenance/Preventative Maintenance37993 81150 Cleaning & Housekeeping Services

    37993 87000 Landscaping/Grounds Care37993 90830 Green Plants and Foliage Care37994 16000 Facility Maintenance and Repair 37994 30300 Fleet Maintenance37994 70700 Predictive Maintenance/Preventative Maintenance

    37994 81150 Cleaning & Housekeeping Services37994 87000 Landscaping/Grounds Care37994 90830 Green Plants and Foliage Care37995 16000 Facility Maintenance and Repair

    37995 30300 Fleet Maintenance37995 70700 Predictive Maintenance/Preventative Maintenance37995 81150 Cleaning & Housekeeping Services37995 87000 Landscaping/Grounds Care37995 90830 Green Plants and Foliage Care37996 30300 Fleet Maintenance

  • 7/27/2019 Useful Excel Functions (Autosaved)

    26/31

    37996 90830 Green Plants and Foliage Care

    37998 16000 Facility Maintenance and Repair 37998 30300 Fleet Maintenance37998 70700 Predictive Maintenance/Preventative Maintenance37998 81150 Cleaning & Housekeeping Services37998 87000 Landscaping/Grounds Care37998 90830 Green Plants and Foliage Care37999 16000 Facility Maintenance and Repair 37999 30300 Fleet Maintenance37999 70700 Predictive Maintenance/Preventative Maintenance37999 81150 Cleaning & Housekeeping Services

    37999 87000 Landscaping/Grounds Care37999 90830 Green Plants and Foliage Care38000 16000 Facility Maintenance and Repair 38000 30300 Fleet Maintenance38000 70700 Predictive Maintenance/Preventative Maintenance38000 81150 Cleaning & Housekeeping Services38000 87000 Landscaping/Grounds Care38000 90830 Green Plants and Foliage Care38001 16000 Facility Maintenance and Repair

    38001 30300 Fleet Maintenance38001 70700 Predictive Maintenance/Preventative Maintenance38001 81150 Cleaning & Housekeeping Services38001 87000 Landscaping/Grounds Care38001 90830 Green Plants and Foliage Care38002 16000 Facility Maintenance and Repair 38002 30300 Fleet Maintenance38002 70700 Predictive Maintenance/Preventative Maintenance38002 81150 Cleaning & Housekeeping Services38002 87000 Landscaping/Grounds Care

    38002 90830 Green Plants and Foliage Care38003 16000 Facility Maintenance and Repair

    38004 16000 Facility Maintenance and Repair 38005 16000 Facility Maintenance and Repair 38005 30300 Fleet Maintenance38005 70700 Predictive Maintenance/Preventative Maintenance38005 81150 Cleaning & Housekeeping Services38005 87000 Landscaping/Grounds Care38005 90830 Green Plants and Foliage Care38006 16000 Facility Maintenance and Repair 38006 30300 Fleet Maintenance38006 70700 Predictive Maintenance/Preventative Maintenance

    38006 81150 Cleaning & Housekeeping Services38006 87000 Landscaping/Grounds Care38006 90830 Green Plants and Foliage Care38007 16000 Facility Maintenance and Repair 38007 30300 Fleet Maintenance38007 70700 Predictive Maintenance/Preventative Maintenance38007 81150 Cleaning & Housekeeping Services38007 87000 Landscaping/Grounds Care38007 90830 Green Plants and Foliage Care38008 16000 Facility Maintenance and Repair

    38008 30300 Fleet Maintenance38008 70700 Predictive Maintenance/Preventative Maintenance38008 81150 Cleaning & Housekeeping Services

  • 7/27/2019 Useful Excel Functions (Autosaved)

    27/31

    38008 87000 Landscaping/Grounds Care

    38008 90830 Green Plants and Foliage Care38009 16000 Facility Maintenance and Repair 38009 30300 Fleet Maintenance38009 70700 Predictive Maintenance/Preventative Maintenance38009 81150 Cleaning & Housekeeping Services38009 87000 Landscaping/Grounds Care38009 90830 Green Plants and Foliage Care38010 16000 Facility Maintenance and Repair 38010 30300 Fleet Maintenance38010 90830 Green Plants and Foliage Care

    38012 16000 Facility Maintenance and Repair 38012 30300 Fleet Maintenance38012 70700 Predictive Maintenance/Preventative Maintenance38012 81150 Cleaning & Housekeeping Services38012 87000 Landscaping/Grounds Care38012 90830 Green Plants and Foliage Care38013 16000 Facility Maintenance and Repair 38013 30300 Fleet Maintenance38013 70700 Predictive Maintenance/Preventative Maintenance

    38013 81150 Cleaning & Housekeeping Services38013 87000 Landscaping/Grounds Care38013 90830 Green Plants and Foliage Care38014 16000 Facility Maintenance and Repair 38014 30300 Fleet Maintenance38014 70700 Predictive Maintenance/Preventative Maintenance38014 81150 Cleaning & Housekeeping Services38014 87000 Landscaping/Grounds Care38014 90830 Green Plants and Foliage Care38015 16000 Facility Maintenance and Repair

    38015 30300 Fleet Maintenance38015 70700 Predictive Maintenance/Preventative Maintenance

    38015 81150 Cleaning & Housekeeping Services38015 87000 Landscaping/Grounds Care38015 90830 Green Plants and Foliage Care38016 16000 Facility Maintenance and Repair 38016 30300 Fleet Maintenance38016 70700 Predictive Maintenance/Preventative Maintenance

  • 7/27/2019 Useful Excel Functions (Autosaved)

    28/31

    Price Table

    Qty Price per Svc Total Amount Product_Number 41 1600010 30300

    24 7070037 8115013 8700021 90830

    55150774272

    340329

    540625

    65327125545362148670087

    224408729646681

    181228321605

    50458320752932721

  • 7/27/2019 Useful Excel Functions (Autosaved)

    29/31

    13

    45364472810839933741554771652

    297281413619710168408284438

    497643124302167606515446102353

    3078

    526024429228

    168132304395283

    7323918532149132478

    229193511

    45746571

  • 7/27/2019 Useful Excel Functions (Autosaved)

    30/31

    135

    8024927432857

    201120271224

    26948125389

    161210398382356

    10915413334839434433

    162133423

    406289

    22202170483290133

  • 7/27/2019 Useful Excel Functions (Autosaved)

    31/31

    Product_Description Business_Segment PriceFacility Maintenance and Repair Maintenance and Repair $92.90

    Fleet Maintenance Maintenance and Repair $123.68

    Predictive Maintenance/Preventative Maintenance Maintenance and Repair $171.66Cleaning & Housekeeping Services Housekeeping and Organization $432.24

    Landscaping/Grounds Care Landscaping and Area Beautification $198.92Green Plants and Foliage Care Landscaping and Area Beautification $135.17