Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Excel Functions

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

INDEX

Text Functions CONCATENATE FIND LEN LEFT RIGHT MID TRIM LOWER UPPER PROPER REPT SUBSTITUTE REPLACE

Date & Time functions DATE DATEDIF DAY EDATE NETWORKDAYS NOW TODAY WORKDAY

Mathematical Functions ROUND ROUNDDOWN ROUNDUP RAND RANDBETWEEN INT MOD CEILING MROUND SUM SUMIF SUMIFS SUMPRODUCT

Statistical COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS CORREL AVERAGE LARGE SMALL MAX MIN MEDIAN MODE RANK

Logical Functions AND IF IFERROR NOT OR

Information Functions ISERROR ISNUMBER ISTEXT ISBLANK ISEVEN ISODD ISNA

Lookup & Reference Functions LOOKUP VLOOKUP HLOOKUP CHOOSE MATCH INDEX ROW COLUMN

INDEX

TEXT; CONCATENATE; PASTE SPECIAL


TEXT

A Salesperson Tom

B Sales $ 2,800

Tom sold $2800.00 worth of goods Tom sold $2800.00 worth of goods

CONCATENATE

Salesperson Tom

Sales 2800

Salesperson Tom sold $2800 worth of goods Salesperson Tom sold $2800 worth of goods PASTE SPECIAL 1. Copy cell H33 and go to Paste special in Home tab Individual Ashok Jatin Shirin Suresh Amandip Vineet Ankush Radhika Paresh Satish Bagesh Anthony Lallan Subjects Science 34 32 23 23 45 43 23 33 43 24 35 32 34 Total marks 103.00 110.00 102.00 Average marks 34.33 36.67 34.00 Percentage 69% 73% 68% 10

Maths 45 43 45 23 30 23 49 50 34 34 32 23 25

English 24 35 34 31 29 28 34 27 22 39 33 29 33

Ravi Rahul

34 44

44 39

21 22

INDEX Find
Text Hello Hello Hello Alan Williams Alan Williams Alan Williams What Does It Do? Letter To Find Position Of Letter e 2 H 1 o 5 a 3 a 11 T 1 =FIND(D4,C4) =FIND(D5,C5) =FIND(D6,C6) =FIND(D7,C7) =FIND(D8,C8,6) =FIND(D9,C9)

This function looks for a specified letter inside another piece of text. When the letter is found the position is shown as a number. If the text contains more than one reference to the letter, the first occurrence is used. An additional option can be used to start the search at a specific point in the text, thus enabling the search to find duplicate occurrences of the letter. If the letter is not found in the text, the result #VALUE is shown.
Syntax

=FIND(LetterToLookFor,TextToLookInside,StartPosition) LetterToLookFor : This needs to be a single character. TextToLookInside : This is the piece of text to be searched through. StartPosition : This is optional, it specifies at which point in the text the search should begin.
Formatting

No special formatting is needed, the result will be shown as a number. Len()


Text Alan Jones Bob Smith Carol Williams Cardiff ABC123 What Does It Do ? Length 10 9 14 7 6 =LEN(C30) =LEN(C31) =LEN(C32) =LEN(C33) =LEN(C34)

This function counts the number of characters, including spaces and numbers, in a piece of text.
Syntax

=LEN(Text)
Formatting

No Special formatting is needed.


Example

This example shows how the =LEN() function is used in a formula which extracts the

second name from a text entry containing both first and second names.
Original Text Carol Williams

=FIND(" ",C50)

This is the position of the space.


Carol Williams 8 =LEN(C50)-FIND(" ",C50)

This is the length of the second name. Calculated by taking the overall length of the complete name and subtracting the position of the space.
=RIGHT(C50,LEN(C50)-FIND(" ",C50))

This is just the second name. Calculated by using the =RIGHT() function to extract the rightmost characters up to the length of the second name.

INDEX
MID() Text ABCDEDF ABCDEDF ABCDEDF ABC-100-DEF ABC-200-DEF ABC-300-DEF Item Size: Large Item Size: Medium Item Size: Small Start Position 1 2 5 100 200 300 Large Medium Small How Many Characters 3 3 2 Mid String ABC BCD ED

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 characters will be picked. Syntax =MID(OriginalText,PositionToStartPicking,NumberOfCharactersToPick) Formatting No special formatting is needed. Example 1 The following table uses the =MID() function to extract a post code from a branch ID used by a company. It is assumed that all branch ID's follow the same format with the letters identifying the postal region being in the 5th and 6th positions. Branch ID DRS-CF-476 DRS-WA-842 HLT-NP-190 Postal Region CF WA NP

LEFT()

Text Alan Jones Alan Jones Alan Jones Cardiff ABC123

Number Of Characters Required 1 2 3 6 4

Left String A Al Ala Cardif ABC1

What Does It Do ? This function displays a specified number of characters from the left hand side of a piece of text. Syntax =LEFT(OriginalText,NumberOfCharactersRequired) Formatting No special formatting is needed. Example The following table was used to extract the first name of a person from their full name. The =FIND() function was used to locate position of the space between the first and second name. The length of the first name is therefore the position of the space minus one character. The =LEFT() function can now extract the first name based on the position of the space. Full Name Alan Jones Bob Smith Carol Williams First Name Alan Bob Carol

=LEFT(B69,FIND(" ",B69,1)) =LEFT(B70,FIND(" ",B70,1)) =LEFT(B71,FIND(" ",B71,1))

RIGHT() Original Text Alan Jones Alan Jones Alan Jones Cardiff ABC123 Number Of Characters Required 1 2 3 6 4 Right String s es nes ardiff C123

What Does It Do ? This function displays a specified number of characters from the right hand side of a piece of text. Syntax =RIGHT(OriginalText,NumberOfCharactersRequired) Formatting No special formatting is needed.

INDEX
Original Text ABCD A B C D Alan Jones ABCD What Does It Do ? Trimmed Text ABCD ABCD Alan Jones ABCD

=TRIM(C4) =TRIM(C5) =TRIM(C6) =TRIM(C7)

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)
Formatting

No special formatting is needed.

INDEX
Upper Case Text ALAN JONES BOB SMITH CAROL WILLIAMS CARDIFF ABC123 What Does It Do ? Lower Case alan jones bob smith carol williams cardiff abc123

=LOWER(C4) =LOWER(C5) =LOWER(C6) =LOWER(C7) =LOWER(C8)

This function converts all characters in a piece of text to lower case.


Syntax

=LOWER(TextToConvert)
Formatting

No special formatting is needed.

INDEX
Original Text alan jones bob smith carOl wiLLiamS cardiff abc123 What Does It Do ? Upper Case ALAN JONES BOB SMITH CAROL WILLIAMS CARDIFF ABC123

=UPPER(C4) =UPPER(C5) =UPPER(C6) =UPPER(C7) =UPPER(C8)

This function converts all characters in a piece of text to upper case.


Syntax

=UPPER(TextToConvert)
Formatting

No special formatting is needed.


Example

See the example for FREQUENCY.

INDEX
Original Text alan jones bob smith caRol wILLIAMS cardiff ABC123 What Does It Do ? Proper Alan Jones Bob Smith Carol Williams Cardiff Abc123

=PROPER(C4) =PROPER(C5) =PROPER(C6) =PROPER(C7) =PROPER(C8)

This function converts the first letter of each word to uppercase, and all subsequent letters are converted to lower case.
Syntax

=PROPER(TextToConvert)
Formatting

No special formatting is needed.

INDEX
Text To Repeat A AB | What Does It Do ? Number Of Repeats 3 3 10 10 Repeated Text AAA ABABAB ---------|||||||||| =REPT(C4,D4) =REPT(C5,D5) =REPT(C6,D6) =REPT(C7,D7)

This function repeats a piece of text a specified number of times. You need to specify the text to be repeated and how many times to repeat it.
Syntax

=REPT(TextToRepeat,Repetitions) The maximum number of repetitions is 200.


Formatting

No special formatting is needed.


Example 1

The following table was used to display a simple histogram of sales figures. The =REPT() function uses the value of Sales, but this is divided by 100 to scale down the number of repetitions to below the maximum of 200.
Month Jan Feb Mar Apr Sales 1,000 5,000 3,000 2,000

|||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||| =REPT("||",D29/100)

Example 2

The =REPT() function has been used to make a digital display for the current time. The time functions of =HOUR(), =MINUTE() and =SECOND() have been used in conjunction with the =NOW() as the basis for the number of repeats. To update the clock press the function key F9.
Clock Hour |||||||||||||||||||| 20 Minute ||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 57 Second ||| 03 =REPT("|",HOUR(NOW()))&" "&TEXT(HOUR(NOW()),"00") =REPT("|",MINUTE(NOW()))&" "&TEXT(MINUTE(NOW()),"00") =REPT("|",SECOND(NOW()))&" "&TEXT(SECOND(NOW()),"00")

INDEX
Old Text New Text To Remove To Insert CD CD Region and hello hello Area &

Original Text ABCDEF ABCDABCD Northern Region Sand and Cement

Updated Text ABhelloEF ABhelloABhello Northern Area S& & Cement Instance To Be Replaced 3 2

=SUBSTITUTE(B4,C4,D4) =SUBSTITUTE(B5,C5,D5) =SUBSTITUTE(B6,C6,D6) =SUBSTITUTE(B7,C7,D7)

Old Text New Text To Remove To Insert Original Text ABCABCABC ABC hello Sand and Cement and &

Updated Text ABCABChello Sand & Cement

=SUBSTITUTE(B10,C10,D10,E10) =SUBSTITUTE(B11,C11,D11,E11)

What Does It Do ?

This function replaces a specified piece of text with a different piece of text. It can either replace all occurrences of the text, or a specific instance. The function is case sensitive.
Syntax

=SUBSTITUTE(OriginalText,TextToRemove,TextToInsert,InstanceToUse) The InstanceToUse is optional, if it is omitted all instances will be substituted.


Formatting

No special formatting is needed.


Note

To cope with upper or lower case in the substitution you can use other text functions such as =UPPER(), =LOWER() or =PROPER() to ensure that the substitution will take place. Table 1 shows how differing text cases alter the result of the substitution. Table 1
Original Text Northern Region Northern region Northern Region Northern Region Northern Region Old Text New Text To Remove To Insert Region Region region Region region Area Area Area area area Updated Text Northern Area Northern region Northern Region Northern area Northern Region =SUBSTITUTE(B39,C39,D39)

Table 2 shows how the =PROPER() function has been used to take account of the mixed cases. Table 2

Original Text Northern Region Northern region Northern Region Northern Region Northern Region

Old Text New Text To Remove To Insert

Updated Text Region Area Northern Area Region Area Northern Area region Area Northern Area Region area Northern Area region area Northern Area =SUBSTITUTE(PROPER(B50),PROPER(C50),PROPER(D50))

ITUTE(B10,C10,D10,E10) ITUTE(B11,C11,D11,E11)

INDEX

Original Text ABCDEFGH ABCDEFGH ABCDEFGH ABCDEFGH What Does It Do ?

Start Characters New Position To Replace Character 2 2 2 2 1 5 1 5 x x hello hello

Modified Text AxCDEFGH AxGH AhelloCDEFGH AhelloGH =REPLACE(C4,D4,E4,F4) =REPLACE(C5,D5,E5,F5) =REPLACE(C6,D6,E6,F6) =REPLACE(C7,D7,E7,F7)

This function replaces a portion of text with a new piece of text. You need to specify where the replacement should start, how many characters to remove and what the new replacement text should be.
Syntax

=REPLACE(OriginalText,StartPosition,NumberOfCharactersToReplace,NewText)
Formatting

No special formatting is needed.

INDEX
DATE() Day 25 25 21 Month 12 12 12 Year 99 99 99 Date 12/25/99 25-Dec-99 December 21, 1999

What Does It Do? This function creates a real date by using three normal numbers typed into separate cells. Syntax =DATE(year,month,day) Formatting The result will normally be displayed in the dd/mm/yy format. By using the Format,Cells,Number,Date command the format can be changed.

DATEDIF()

FirstDate 1-Jan-60 1-Jan-60 1-Jan-60 1-Jan-60 1-Jan-60 1-Jan-60

SecondDate 10-May-70 10-May-70 10-May-70 10-May-70 10-May-70 10-May-70

Interval

days months years yeardays yearmonths monthdays

Difference 3782 124 10 130 4 9

What Does It Do? This function calculates the difference between two dates. It can show the result in weeks, months or years. Syntax =DATEDIF(FirstDate,SecondDate,"Interval") FirstDate : This is the earliest of the two dates. SecondDate : This is the most recent of the two dates. "Interval" : This indicates what you want to calculate. These are the available intervals. "d" Days between the two dates. "m" Months between the two dates. "y" Years between the two dates. "yd" Days between the dates, as if the dates were in the same year. "ym" Months between the dates, as if the dates were in the same year. "md" Days between the two dates, as if the dates were in the same month and year. Formatting No special formatting is needed.

Birth date : Years lived : and the months : and the days :

16-May-84 28 11 23

You can put this all together in one calculation, which creates a text version. Age is 28 Years, 11 Months and 23 Days ="Age is "&DATEDIF(C55,TODAY(),"y")&" Years, "&DATEDIF(C55,TODAY(),"ym")&" Months and "&DATEDIF(C55,TODAY(),

month and year.

Months and "&DATEDIF(C55,TODAY(),"md")&" Days"

INDEX
Full Date 25-Dec-98 9-May-13 9-May-13 What Does It Do? The Day 25 Mon 9 9

=DAY(C4) =DAY(C5) =DAY(C6)

This function extracts the day of the month from a complete date.
Syntax

=DAY(value)
Formatting

Normally the result will be a number, but this can be formatted to show the actual day of the week by using Format,Cells,Number,Custom and using the code ddd or dddd.
Example

The =DAY function has been used to calculate the name of the day for your birthday.
Please enter your date of birth in the format dd/mm/yy : You were born on : 3/25/1962 Wednesday 25

=DAY(F21)

INDEX
Start Date 1-Jan-98 2-Jan-98 2-Jan-98 What Does It Do? Plus Months 3 3 -3 End Date 1-Apr-98 2-Apr-98 2-Oct-97

=EDATE(C4,D4) =EDATE(C5,D5) =EDATE(C6,D6)

This function is used to calculate a date which is a specific number of months in the past or in the future.
Syntax

=EDATE(StartDate,Months)
Formatting

The result will normally be expressed as a number, this can be formatted to represent a date by using the Format,Cells,Number,Date command.
Example

This example was used by a company hiring contract staff. The company needed to know the end date of the employment. The Start date is entered. The contract Duration is entered as months. The =EDATE() function has been used to calculate the end of the contract.
Start Tue 06-Jan-98 Mon 12-Jan-98 Fri 09-Jan-98 Fri 09-Jan-98 Mon 19-Jan-98 Mon 26-Jan-98 Mon 12-Jan-98 Duration 3 3 4 3 3 3 3 End Mon 06-Apr-98 Sun 12-Apr-98 Sat 09-May-98 Thu 09-Apr-98 Sun 19-Apr-98 Sun 26-Apr-98 Sun 12-Apr-98

=EDATE(C27,D27) =EDATE(C28,D28) =EDATE(C29,D29) =EDATE(C30,D30) =EDATE(C31,D31) =EDATE(C32,D32) =EDATE(C33,D33)

The company decide not to end contracts on Saturday or Sunday. The =WEEKDAY() function has been used to identify the actaul weekday number of the end date. If the week day number is 6 or 7, (Sat or Sun), then 5 is subtracted from the =EDATE() to ensure the end of contract falls on a Friday.
Start Tue 06-Jan-98 Mon 12-Jan-98 Fri 09-Jan-98 Fri 09-Jan-98 Mon 19-Jan-98 Duration 3 3 4 3 3 End Mon 06-Apr-98 Fri 10-Apr-98 Fri 08-May-98 Thu 09-Apr-98 Fri 17-Apr-98

Mon 26-Jan-98 Mon 12-Jan-98

3 3

Fri 24-Apr-98 Fri 10-Apr-98

=EDATE(C48,D48)-IF(WEEKDAY(EDATE(C48,D48),2)>5,WEEKDAY(EDATE(C48,D48),2)-5,0)

INDEX
Start Date 1-Mar-98 25-Apr-98 24-Dec-98 What Does It Do? End Date 7-Mar-98 30-Jul-98 5-Jan-99 Work Days 5 69 9

=NETWORKDAYS(C4,D4) =NETWORKDAYS(C5,D5) =NETWORKDAYS(C6,D6)

This function will calculate the number of working days between two dates. It will exclude weekends and any holidays.
Syntax

=NETWORKDAYS(StartDate,EndDate,Holidays) Holidays : This is a list of dates which will be excluded from the calculation, such as Xmas and Bank holidays.
Formatting

The result will be shown as a number.


Note

The calculation does not include the last day. The result of using 1-Jan-98 and 5-Jan-98 will give a result of 4. To correct this add 1 to the result. =NETWORKDAYS(Start,End,Holidays)+1
Example

The following example shows how a list of Holidays can be created.


Start Date Mon 02-Mar-98 Mon 02-Mar-98 Mon 27-Apr-98 End Date Fri 06-Mar-98 Fri 13-Mar-98 Fri 01-May-98 Holidays 1-May-98 25-Dec-98 1-Jan-97 1-Jan-98 1-Jan-99 Work Days 5 10 4

=NETWORKDAYS(B28,C28,C33:C37) =NETWORKDAYS(B29,C29,C33:C37) =NETWORKDAYS(B30,C30,C33:C37)

Bank Holiday Xmas New Year New Year New Year

INDEX

The current Date and Time 5/9/2013 20:57 41403.87295 What Does It Do?

=NOW() =NOW()

This function shows the current date and time. The result will be updated each time the worksheet is opened and every time an entry is made anywhere on the worksheet.
Syntax

=NOW()
Formatting

The result will be shown as a date and time. If it is formatted to show as a number the integer part is used for the date and the decimal portion represent the time.

INDEX
Today Is 9-May-13 What Does It Do?

=TODAY()

Use this to show the current date.


Syntax

=TODAY()
Formatting

The result will normally be displayed using the DD-MMM-YY format.


Example

The following example shows how the Today function is used to calculate the number of days since a particular day.
Date 1-Jan-97 10-Aug-97 Days Since 5972 5751

=TODAY()-C20 =TODAY()-C21

Note that the result is actually the number of days before todays date. To calculate a result which includes the current date an extra 1 will need to be added.
Date 1-Jan-97 10-Aug-97 Days Since 5973 5752

=TODAY()-C28+1 =TODAY()-C29+1

Example

The following example shows the number of days from today until the year 2000.
Year 2000 01-Jan-2000 Days Until -4877

=C36-TODAY()

INDEX
StartDate 1-Jan-98 1-Jan-98 What Does It Do? Days 28 28 Result 10-Feb-98 10-Feb-98

=WORKDAY(D4,E4) =WORKDAY(D5,E5)

Use this function to calculate a past or future date based on a starting date and a specified number of days. The function excludes weekends and holidays and can therefore be used to calculate delivery dates or invoice dates.
Syntax

=WORKDAY(StartDate,Days,Holidays)
Formatting

The result will normally be shown as a number which can be formatted to a normal date by using Format,Cells,Number,Date.
Example

The following example shows how the function can be used to calculate delivery dates based upon an initial Order Date and estimated Delivery Days.
Order Date Mon 02-Feb-98 Tue 15-Dec-98 Holidays Fri 01-May-98 Fri 25-Dec-98 Wed 01-Jan-97 Thu 01-Jan-98 Fri 01-Jan-99 Delivery Days 2 28 Delivery Date Wed 04-Feb-98 Tue 26-Jan-99

=WORKDAY(D25,E25,D28:D32)

Bank Holiday Xmas New Year New Year New Year

INDEX

Number 1.47589 1.47589 1.47589 13643.47589 13643.47589 13643.47589 What Does It Do ?

Places To Rounded Round Number 0 1 2 -1 -2 -3 1 1.5 1.48 13640 13600 14000 =ROUND(C4,D4) =ROUND(C5,D5) =ROUND(C6,D6) =ROUND(C7,D7) =ROUND(C8,D8) =ROUND(C9,D9)

This function rounds a number to a specified amount od decimal places. If 0 is used the number is rounded to the nearest whole number. If a negative amount of rounding is used the figures to the left of the decimal point are rounded.
Syntax

=ROUND(NumberToRound,DecimalPlacesToUse)
Formatting

No special formatting is needed.

INDEX

Number 1.47589 1.47589 1.47589 13643.48 13643.48 13643.48 What Does It Do ?

Places To Rounded Round Down 0 1 2 -1 -2 -3 1 1.4 1.47 13640 13600 13000 =ROUNDDOWN(C4,D4) =ROUNDDOWN(C5,D5) =ROUNDDOWN(C6,D6) =ROUNDDOWN(C7,D7) =ROUNDDOWN(C8,D8) =ROUNDDOWN(C9,D9)

This function rounds a number down to a specified amount of decimal places. If 0 is used the number is rounded down to the nearest whole number. If a negative amount of rounding is used the figures to the left of the decimal point are rounded.
Syntax

=ROUNDDOWN(NumberToRound,DecimalPlacesToUse)
Formatting

No special formatting is needed.

INDEX

Number 1.47589 1.47589 1.47589 13643.48 13643.48 13643.48 What Does It Do ?

Places To Rounded Round Up 0 1 2 -1 -2 -3 2 1.5 1.48 13650 13700 14000 =ROUNDUP(C4,D4) =ROUNDUP(C5,D5) =ROUNDUP(C6,D6) =ROUNDUP(C7,D7) =ROUNDUP(C8,D8) =ROUNDUP(C9,D9)

This function rounds a number up to a specified amount of decimal places. If 0 is used the number is rounded up to the nearest whole number. If a negative amount of rounding is used the figures to the left of the decimal point are rounded.
Syntax

=ROUNDUPNumberToRound,DecimalPlacesToUse)
Formatting

No special formatting is needed.

INDEX

Random greater than or equal to 0 but less than 1. 0.034210217 =RAND() Random greater than or equal to 0 but less than 10 8.433740704 =RAND()*10 Random between 5 and 10. 8.362285386 =RAND()*(10-5)+5 What Does It Do ?

This function creates a random number >=0 but <1. The number will change each time the worksheet recalculates, or when F9 is pressed.
Syntax

=RAND()
Formatting

No special formatting is needed.


Examples

The following examples show how the =RAND() function has been used to randomly sort list of information. A list of cards has been entered in column C, and =RAND() in column D. By clicking inside the random numbers and then using Data, Sort or the Sort button the cards will be shuffled. The same technique has been used to generate a list of six winning lottery numbers.
Card Clubs 8 Clubs 6 Diamond 9 Spades 13 Clubs 9 Diamond 7 Diamond 4 Clubs 10 Spades 3 Hearts 6 Hearts 4 Diamond 8 Hearts 11 Random 0.022553 0.608352 0.998183 0.738217 0.746309 0.538776 0.597069 0.870806 0.583127 0.342951 0.495387 0.471604 0.109747 Lottery 29 34 30 41 40 37 26 32 21 19 7 10 16 Random 0.598900126 0.310799156 0.873932432 0.099403288 0.087693896 0.224883665 0.90362425 0.146903471 0.763136678 0.651790817 0.454604246 0.885461588 0.121347228

Clubs 3 Clubs 13 Spades 5 Diamond 3 Spades 2 Diamond 6 Clubs 5 Spades 1 Clubs 12 Hearts 10 Hearts 13 Spades 7 Spades 6 Diamond 12 Hearts 3 Hearts 5 Hearts 8 Hearts 1 Diamond 13 Hearts 9 Clubs 4 Diamond 5 Spades 4 Clubs 1 Spades 8 Hearts 7 Diamond 1 Clubs 2 Hearts 2 Diamond 11 Clubs 7 Spades 12 Spades 10 Clubs 11 Diamond 2 Diamond 10 Spades 9 Spades 11 Hearts 12

0.101117 0.735665 0.900462 0.536058 0.391174 0.353064 0.030209 0.821152 0.701127 0.910703 0.028821 0.94503 0.530446 0.580738 0.741426 0.080954 0.829302 0.264918 0.557614 0.581078 0.242203 0.612081 0.185445 0.21746 0.490261 0.486026 0.288133 0.48577 0.739571 0.599929 0.973362 0.000906 0.214327 0.219554 0.16575 0.257718 0.704335 0.30963 0.454433

8 48 43 44 4 3 45 47 49 35 27 1 13 31 5 18 39 23 12 11 20 33 42 24 2 14 25 9 38 15 28 17 6 22 46 36

0.136677149 0.541420532 0.323905768 0.098195235 0.985178992 0.819022395 0.992134881 0.279568635 0.043803386 0.825965725 0.620735982 0.489173553 0.455977175 0.369581283 0.430684896 0.749420244 0.224464043 0.203343725 0.592492643 0.006247102 0.568037196 0.518551024 0.602037465 0.545927679 0.698949657 0.831296309 0.379507936 0.369214146 0.334051492 0.610744958 0.587392976 0.633420516 0.249230378 0.848918452 0.802734099 0.612531871

INDEX
Low 5 1 What Does It Do ? High 10 49 Random 6 40

=RANDBETWEEN(C4,D4) =RANDBETWEEN(C5,D5)

This function produces a random whole number between two specified numbers. The random number will change each time the spreadsheet is recalculated or F9 is pressed.
Syntax

=RANDOMBETWEEN(LowLimit,HighLimit)
Formatting

No special formatting is needed.


Example

The following table shows how the =RANDBETWEEN() has been used to generate six numbers to use for the National Lottery. Note that the function does not check to ensure all numbers are unique, the same number could be generated twice or more.
The Winning Ticket! 39 44 17 7 16 49 30 =RANDBETWEEN($C$24,$D$24) =RANDBETWEEN($C$24,$D$24) =RANDBETWEEN($C$24,$D$24) =RANDBETWEEN($C$24,$D$24) =RANDBETWEEN($C$24,$D$24) =RANDBETWEEN($C$24,$D$24) =RANDBETWEEN($C$24,$D$24)

Lottery Numbers 1 49

Press function Key F9 to recalculate.

Number 1 Number 2 Number 3 Number 4 Number 5 Number 6 Bonus ball

All OK {=IF(SUM(1/COUNTIF(E24:E30,E24:E30))<>7,"Duplicates! Spin again","All OK")}

This formula is used to determine whether all the numbers are different. It is entered as an array using Ctrl+Shift+Enter.

INDEX
Number 1.5 2.3 10.75 -1.47589 What Does It Do ? Integer 1 2 10 -2

=INT(C4) =INT(C5) =INT(C6) =INT(C7)

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


Syntax

=INT(Number)
Formatting

No special formatting is needed.


Example

The following table was used by a school to calculate the age a child when the school year started. A child can only be admitted to school if they are over 8 years old. The Birth Date and the Term Start date are entered and the age calculated. Table 1 shows the age of the child with decimal places Table 1
Birth Date 1-Jan-80 5-Feb-81 20-Oct-79 1-Mar-81 Term Start 1-Sep-88 1-Sep-88 1-Sep-88 1-Sep-88 Age 8.668035592 =(D27-C27)/365.25 7.570157426 8.8678987 7.504449008

Table 2 shows the age of the child with the Age formatted with no decimal places. This has the effect of increasing the child age. Table 2
Birth Date 1-Jan-80 5-Feb-81 20-Oct-79 1-Mar-81 Term Start 1-Sep-88 1-Sep-88 1-Sep-88 1-Sep-88 Age 9 8 9 8 =(D38-C38)/365.25

Table 3 shows the age of the child with the Age calculated using the =INT() function to remove the decimal part of the number to give the correct age.

Table 3
Birth Date 1-Jan-80 5-Feb-81 20-Oct-79 1-Mar-81 Term Start 1-Sep-88 1-Sep-88 1-Sep-88 1-Sep-88 Age 8 7 8 7 =INT((D49-C49)/365.25)

Note

The age is calculated by subtracting the Birth Date from the Term Start to find the age of the child in days. The number of days is then divided by 365.25 The reason for using 365.25 is to take account of the leap years.

INDEX
Number 12 20 18 9 24 What Does It Do ? Divisor 5 7 3 2 7 Remainder 2 6 0 1 3

=MOD(C4,D4) =MOD(C5,D5) =MOD(C6,D6) =MOD(C7,D7) =MOD(C8,D8)

This function calculates the remainder after a number has been divided by another number.
Syntax

=MOD(Number,Divisor)
Formatting

No special formatting is needed.

INDEX
Number 2.1 1.5 1.9 20 25 40 What Does It Do ? Raised Up 3 2 2 30 30 60

=CEILING(C4,1) =CEILING(C5,1) =CEILING(C6,1) =CEILING(C7,30) =CEILING(C8,30) =CEILING(C9,30)

This function rounds a number up to the nearest multiple specified by the user.
Syntax

=CEILING(ValueToRound,MultipleToRoundUpTo) The ValueToRound can be a cell address or a calculation.


Formatting

No special formatting is needed.


Example 1

The following table was used by a estate agent renting holiday apartments. The properties being rented are only available on a weekly basis. When the customer supplies the number of days required in the property the =CEILING() function rounds it up by a multiple of 7 to calculate the number of full weeks to be billed.
Days To Be Billed 7 7 14 =CEILING(D28,7) =CEILING(D29,7) =CEILING(D30,7)

Customer 1 Customer 2 Customer 3

Days Required 3 4 10

Example 2

The following table was used by a builders merchant delivering products to a construction site. The merchant needs to hire trucks to move each product. Each product needs a particular type of truck of a fixed capacity. Table 1 calculates the number of trucks required by dividing the Units To Be Moved by the Capacity of the truck. This results of the division are not whole numbers, and the builder cannot hire just part of a truck. Table 1
Item Bricks Units To Be Moved 1000 Truck Capacity 300 Trucks Needed 3.33 =D45/E45

Wood Cement

5000 2000

600 350

8.33 5.71

=D46/E46 =D47/E47

Table 2 shows how the =CEILING() function has been used to round up the result of the division to a whole number, and thus given the exact amount of trucks needed. Table 2
Item Bricks Wood Cement Units To Be Moved 1000 5000 2000 Truck Capacity 300 600 350 Trucks Needed 4 9 6 =CEILING(D54/E54,1) =CEILING(D55/E55,1) =CEILING(D56/E56,1)

Example 3

The following tables were used by a shopkeeper to calculate the selling price of an item. The shopkeeper buys products by the box. The cost of the item is calculated by dividing the Box Cost by the Box Quantity. The shopkeeper always wants the price to end in 99 pence. Table 1 shows how just a normal division results in varying Item Costs. Table 1
Item Plugs Sockets Junctions Adapters Box Qnty 11 7 5 16 Box Cost 20 18.25 28.10 28 Cost Per Item 1.81818 2.60714 5.62000 1.75000 =D69/C69 =D70/C70 =D71/C71 =D72/C72

Table 2 shows how the =CEILING() function has been used to raise the Item Cost to always end in 99 pence. Table 2
Item Plugs Sockets Junctions Adapters In Box 11 7 5 16 Box Cost 20 18.25 28.10 28 Cost Per Item Raised Cost 1.81818 1.99 2.60714 2.99 5.62000 5.99 1.75000 1.99 =INT(E83)+CEILING(MOD(E83,1),0.99)

Explanation =INT(E83) =MOD(E83,1) =CEILING(MOD(E83),0.99)

Calculates the integer part of the price. Calculates the decimal part of the price. Raises the decimal to 0.99

INDEX
Rounded Value 100 100 150 150 150 =MROUND(C4,D4) =MROUND(C5,D5) =MROUND(C6,D6) =MROUND(C7,D7) =MROUND(C8,D8)

Number 110 120 150 160 170 What Does It Do ?

Multiple 50 50 50 50 50

This function rounds a number up or down to the nearest multiple specified by the user.
Syntax

=MROUND(NumberToRound,MultipleToUse)
Formatting

No special formatting is needed.

INDEX
SUMIF() Item Brakes Tyres Brakes Service Service Window Tyres Tyres Clutch Date 1-Jan-98 10-May-98 1-Feb-98 1-Mar-98 5-Jan-98 1-Jun-98 1-Apr-98 1-Mar-98 1-May-98 Cost 80 25 80 150 300 50 200 100 250 160 325 1000 service 450

Total cost of all Brakes bought. Total cost of all Tyres bought. Total of items costing 100 or above. Total cost of item typed in following cell.

What Does It Do ? This function adds the value of items which match criteria set by the user. Syntax =SUMIF(RangeOfThingsToBeExamined,CriteriaToBeMatched,RangeOfValuesToTotal) =SUMIF(C4:C12,"Brakes",E4:E12) This examines the names of products in C4:C12. It then identifies the entries for Brakes. It then totals the respective figures in E4:E12 This examines the values in E4:E12. If the value is >=100 the value is added to the total.

=SUMIF(E4:E12,">=100")

Formatting No special formatting is needed.

INDEX
SUMPRODUCT() Item Tyres Filters Bulbs Sold 5 2 3 Price 100 10 2 526

Total Sales Value :

What Does It Do ? This function uses at least two columns of values. The values in the first column are multipled with the corresponding value in the second column. The total of all the values is the result of the calculation. Syntax =SUMPRODUCT(Range1, Range, Range3 through to Range30) Formatting No special formatting is needed. Example The following table was used by a drinks merchant to keep track of stock. The merchant needed to know the total purchase value of the stock, and the potential value of the stock when it is sold, takinging into account the markup percentage. The =SUMPRODUCT() function is used to multiply the Cases In Stock with the Case Price to calculate what the merchant spent in buying the stock. The =SUMPRODUCT() function is used to multiply the Cases In Stock with the Bottles In Case and the Bottle Setting Price, to calculate the potential value of the stock if it is all sold.

Product Red Wine White Wine Champagne Beer

Cases In Stock 10 8 5 50

Case Price 120 130 200 24

Bottles In Case 10 10 6 12

Bottle Cost 12.00 13.00 33.33 2.00 =D39/E39

Markup 25% 25% 80% 20%

Bottle Selling Price 15.00 16.25 60.00 2.40 =F39+F39*G39

Total Value Of Stock : Total Selling Price Of Stock : Profit :

4,440 6,040 1,600

=F39+F39*G39

INDEX
Sumproduct & Sumif

Year 1990 1990 1990 1990 1990 1990 1990 1990 1990 1990 1990 1990 1990

City Bangalore Bangalore New Delhi New Delhi Mumbai Mumbai Chennai Chennai Pune Pune Kolkatta Kolkatta Ahmedabad

Item Answering Machine Telephone Answering Machine Telephone Answering Machine Telephone Answering Machine Telephone Answering Machine Telephone Answering Machine Telephone Answering Machine

Units Sold 500 1000 200 600 700 7600 400 1800 700 5400 300 2700 800

Average Sales Price 34.80 45.00 72.50 45.00 82.86 47.37 65.25 45.00 78.71 47.50 67.67 46.67 79.75

Turnover 17,400 45,000 14,500 27,000 58,000 360,000 26,100 81,000 55,100 256,500 20,300 126,000 63,800 1,150,700

1 2 3 4 5 6

Find the total turnover using the sumproduct formula Find the number of answering machines sold 1990 Find the number of telephone sold 1990 Find the revenue generated by answering machines in 1990 Find the revenue generated by telephone in 1990 Find average sales value of each telephone based on the average sales price witnessed in each city

1150700 3600 19100 255200 895500 46.09

Hint Rs. units units Rs. Rs. Rs./unit <== Use sumproduct function <== Use sumif function <== Use sumif function <== Use sumif function <== Use sumif function <== Use averageif function

INDEX
COUNT Entries To Be Counted 20 0 -20 1-Jan-88 21:30 0.039831664 Hello #DIV/0! Count 3 3 3 3 3 3 2 2 2

10 10 10 10 10 10 10 10 10

30 30 30 30 30 30 30 30 30

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) Formatting No special formatting is needed. Example The following table was used by a builders merchant to calculate the number of sales for various products in each month. Item Bricks Wood Glass Metal Count Jan 1,000 2,000 1,000 3 Feb 5,000 1,000 2 0 Mar

INDEX
COUNTA Entries To Be Counted 20 0 -20 1-Jan-88 21:30 0.817796256 Hello #DIV/0!

10 10 10 10 10 10 10 10 10

30 30 30 30 30 30 30 30 30

3 3 3 3 3 3 2 3 3

=COUNTA(C4:E4) =COUNTA(C5:E5) =COUNTA(C6:E6) =COUNTA(C7:E7) =COUNTA(C8:E8) =COUNTA(C9:E9) =COUNTA(C10:E10) =COUNTA(C11:E11) =COUNTA(C12:E12)

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) Formatting No special formatting is needed. Example The following table was used by a school to keep track of the examinations taken by each student. Each exam passed was graded as 1, 2 or 3. A failure was entered as Fail. The school needed to known how many students sat each exam. The school also needed to know how many exams were taken by each student. The =COUNTA() function has been used because of its ability to count text and numeric entries. Maths A B C D E Fail 2 Fail 1 English 1 1 3 Art 1 3 1 Fail 2 History

1 Fail

How many students sat each Exam. Maths English Art History 4 3 5 2 =COUNTA(D35:D39)

y each student.

Exams Taken By Each student 2 3 3 2 4 =COUNTA(D39:G39)

INDEX
COUNTBLANK

Range To Test 1 Hello 3 0 1-Jan-98 5

Blanks 2

=COUNTBLANK(C4:C11)

What Does It Do ? This function counts the number of blank cells in a range. Syntax =COUNTBLANK(RangeToTest) Formatting No special formatting is needed. Example The following table was used by a company which was balloting its workers on whether the company should have a no smoking policy. Each of the departments in the various factories were questioned. The response to the question could be Y or N. As the results of the vote were collated they were entered in to the table. The =COUNTBLANK() function has been used to calculate the number of departments which have not yet registered a vote. Admin Y Accounts N Y Production Y N Y Y Y Y Y Personnel N N N Y Y 16 14 10 =COUNTBLANK(C32:F41) =COUNTIF(C32:F41,"Y") =COUNTIF(C32:F41,"N")

Factory 1 Factory 2 Factory 3 Factory 4 Factory 5 Factory 6 Factory 7 Factory 8 Factory 9 Factory 10

N Y Y N Y

Y N N N

Votes not yet registered : Votes for Yes : Votes for No :

INDEX
COUNTIF() Item Brakes Tyres Brakes Service Service Window Tyres Tyres Clutch Date 1-Jan-98 10-May-98 1-Feb-98 1-Mar-98 5-Jan-98 1-Jun-98 1-Apr-98 1-Mar-98 1-May-98 Cost 80 25 80 150 300 50 200 100 250 2 3 5 2 =COUNTIF(C4:C12,"Brakes") =COUNTIF(C4:C12,"Tyres") =COUNTIF(E4:E12,">=100") =COUNTIF(C4:C12,E18)

How many Brake Shoes Have been bought. How many Tyres have been bought. How many items cost 100 or above. Type the name of the item to count. SERVICE

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") Formatting No special formatting is needed.

INDEX
COUNT, COUNTA, COUNTBLANK & COUNTIF

Student Name

Maths

Science

English 82 47 85 55 42 90 58 88 79 89 66 59 70 77 56 54 58 60 60 36 73 37

Hindi 58 71 38 61 60 35 75 82 50 90 58 57 66 75 46 40 87 61 67 38 87

History 90 84 83 70 76 61 78 53 89 89 89 60 58 63 43 76 56 79 53 83

Geography 74 60 82 41 44 81 95 66 83 91 80 42 56 44 45 78 91 37 55 59 47

Ashok 46 84 Jatin 70 76 Shirin 69 46 Suresh 83 38 Amandip 74 48 Vineet 42 Ankush 45 64 Radhika 44 58 Paresh 82 37 Satish 68 Bagesh 89 87 Anthony 71 87 Lallan 44 66 Ravi 70 55 Rahul 51 54 Gitesh 54 Nandkumar 56 68 Abhay 84 52 Abhishek 69 39 Neeta 38 74 Veena 51 63 Teena 72 52 *Blank suggests that the student was absent for the test

1 2 3

Total number of students appearing for the exams Number of subjects for which vineet was absent Number of students present for history paper

22 2 20

Economics 39 94 56 83 90 59 85 78 76 92 74 70 57 56 57 55 88 73 74 60 38

Civics 36 49 55 82 72 92 57 80 84 49 81 73 68 47 62 52 81 77 38 56 50

Hint <== Use counta function <== Use countblank function <== Use count function

INDEX Table 1
Air Cond Sales Avg Temp 20 100 30 200 30 300 40 200 50 400 50 400

Table 2
Advertising Costs 2,000 1,000 5,000 1,000 8,000 1,000

Month Jan Feb Mar Apr May Jun

Sales 20,000 30,000 20,000 40,000 40,000 20,000 28%

Correlation

0.864

Correlation

=CORREL(D5:D10,E5:E10) What Does It Do ?

=CORREL(G5:G10,H5:H10)

This function examines two sets of data to determine the degree of relationship between the two sets. The result will be a decimal between 0 and 1. The larger the result, the greater the correlation. In Table 1 the Monthly temperature is compared against the Sales of air conditioning units. The correlation shows that there is an 0.864 realtionship between the data. In Table 2 the Cost of advertising has been compared to Sales. It can be formatted as percentage % to show a more meaning full result. The correlation shows that there is an 28% realtionship between the data.
Syntax

=CORREL(Range1,Range2)
Formatting

The result will normally be shown in decimal format.

INDEX
Mon Temp 30 Rain 0 Mon 30 0 Tue 31 0 Tue Wed Thu Fri Sat Sun Average 32 29 26 28 27 29 =AVERAGE(D4:J4) 0 4 6 3 1 2 =AVERAGE(D5:J5) Wed Thu Fri Sat Sun Average 32 29 26 28 27 28.6667 =AVERAGE(D8:J8) 0 4 6 3 1 2.33333 =AVERAGE(D9:J9)

Temp Rain

Mon Tue Wed Thu Fri Sat Sun Average Temp 30 No 32 29 26 28 27 28.6667 =AVERAGE(D12:J12) Rain 0 Reading 0 4 6 3 1 2.33333 =AVERAGE(D13:J13) What Does It Do ?

This function calculates the average from a list of numbers. If the cell is blank or contains text, the cell will not be used in the average calculation. If the cell contains zero 0, the cell will be included in the average calculation.
Syntax

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


Formatting

No special formatting is needed.


Note

To calculate the average of cells which contain text or blanks use =SUM() to get the total and then divide by the count of the entries using =COUNTA().
Mon Tue Wed Thu Fri Sat Sun Average 30 No 32 29 26 28 27 24.5714 =SUM(D31:J31)/COUNTA(D31:J31) 0 Reading 0 4 6 3 1 2 =SUM(D32:J32)/COUNTA(D32:J32) Tue Wed Thu Fri Sat Sun Average 32 29 26 28 27 28.6667 =SUM(D35:J35)/COUNTA(D35:J35) 0 4 6 3 1 2.33333 =SUM(D36:J36)/COUNTA(D36:J36)

Temp Rain

Mon Temp 30 Rain 0

Further Usage

INDEX
MAX & MIN

Values 120 Dates 1-Jan-98

800

100

120

250

25-Dec-98

31-Mar-98

27-Dec-98

4-Jul-98

What Does It Do ? This function picks the highest value from a list of data. Syntax =MAX(Range1,Range2,Range3... through to Range30) Formatting No special formatting is needed. Example 1 In the following example the =MAX() function has been used to find the highest value for each region, month and overall. Sales North South East West Month Min Overall Max Jan 5,000 5,800 3,500 12,000 3,500 12,000 =MAX(C23:E26) Feb 6,000 7,000 2,000 4,000 2,000 Mar 4,500 3,000 10,000 6,000 3,000 =MAX(E23:E26) Region Max 6,000 7,000 10,000 12,000

Maximum 800 Minimum 1-Jan-98

=MAX(C4:G4)

=MAX(C7:G7)

=MAX(C23:E23)

INDEX
Values 120 800 100 120 250 What Does It Do ? Highest Value 2nd Highest Value 3rd Highest Value 4th Highest Value 5th Highest Value 800 250 120 120 100 =LARGE(C4:C8,1) =LARGE(C4:C8,2) =LARGE(C4:C8,3) =LARGE(C4:C8,4) =LARGE(C4:C8,5)

This function examines a list of values and picks the value at a user specified position in the list.
Syntax

=LARGE(ListOfNumbersToExamine,PositionToPickFrom)
Formatting

No special formatting is needed.


Example

The following table was used to calculate the top 3 sales figures between Jan, Feb and Mar.
Sales North South East West Jan 5,000 5,800 3,500 12,000 Feb 6,000 7,000 2,000 4,000 12,000 10,000 7,000 Mar 4,500 3,000 10,000 6,000 =LARGE(D24:F27,1) =LARGE(D24:F27,2) =LARGE(D24:F27,3)

Highest Value 2nd Highest Value 3rd Highest Value Note

Another way to find the Highest and Lowest values would have been to use the =MAX() and =MIN() functions.
Highest Lowest 12,000 2,000 =MAX(D24:F27) =MIN(D24:F27)

INDEX
Values 120 800 100 120 250 What Does It Do ? Lowest Value 2nd Lowest Value 3rd Lowest Value 4th Lowest Value 5th Lowest Value 100 120 120 250 800 =SMALL(C4:C8,1) =SMALL(C4:C8,2) =SMALL(C4:C8,3) =SMALL(C4:C8,4) =SMALL(C4:C8,5)

This function examines a list of values and picks the value at a user specified position in the list.
Syntax

=SMALL(ListOfNumbersToExamine,PositionToPickFrom)
Formatting

No special formatting is needed.


Example

The following table was used to calculate the bottom 3 sales figures between Jan, Feb and Mar.
Sales North South East West Jan 5,000 5,800 3,500 12,000 Feb 6,000 7,000 2,000 4,000 2,000 3,000 3,500 Mar 4,500 3,000 10,000 6,000 =SMALL(D24:F27,1) =SMALL(D24:F27,2) =SMALL(D24:F27,3)

Lowest Value 2nd Lowest Value 3rd Lowest Value Note

Another way to find the Highest and Lowest values would have been to use the =MAX() and =MIN() functions.
Highest Lowest 12,000 2,000 =MAX(D24:F27) =MIN(D24:F27)

INDEX
Value1 20 2000 10 Value1 20 20 What Does It Do ? Value2 50 1000 20 Value2 40 20 Value3 10 10 40 Value3 30 40 Value4 30 20 40 Value4 10 20 Value5 40 8000 40 Median 30 1000 40 Median 25 20

=MEDIAN(C4:G4) =MEDIAN(C6:G6) =MEDIAN(C8:G8)

=MEDIAN(C11:F11) =MEDIAN(C13:F13)

This function finds the median value of a group of values. The median is not the average, it is the half way point where half the numbers in the group are larger than it and half the numbers are less than it. If there is no exact median number in the group, the two nearest the half way point are added and their average is used as the median.
Syntax

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


Formatting

No special formatting is needed.

INDEX

Value1 20 40 10 20 10 10 What Does It Do ?

Value2 50 20 10 20 20 20

Value3 10 40 99 99 20 30

Value4 10 10 20 10 99 40

Value5 40 40 20 10 10 50

Mode 10 40 10 20 10 #N/A

=MODE(C4:G4) =MODE(C6:G6) =MODE(C8:G8) =MODE(C9:G9) =MODE(C10:G10) =MODE(C12:G12)

This function displays the most frequently occurring number in a group of numbers. For it to work correctly there must be at least two numbers which are the same. If all the values in the group are unique the function shows the error #N/A. When there is more than one set of duplicates, the number closest to the beginning of the group will be used. (Which is not really an accurate answer!)
Syntax

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


Formatting

No special formatting is needed.


Example

The following table shows garments sold in a clothes shop. The shopkeeper wants to keep track of the most commonly sold size. The =MODE() function has been used to calulate this.
Order 001 002 003 004 005 006 007 008 009 010 011 012 013 Garmet Blouse Skirt Shirt Blouse Skirt Dress Shirt Blouse Dress Shirt Dress Skirt Skirt Size 10 10 8 10 12 8 10 10 8 10 12 12 10

Most frequently ordered size :

10 =MODE(D33:D52)

Count of size 8 :

6 =COUNTIF(D33:D52,"8") 11 =COUNTIF(D33:D52,"10") 3 =COUNTIF(D33:D52,"12")

Count of size 10 :

Count of size 12 :

014 015 016 017 018 019 020 Note

Shirt Dress Shirt Blouse Blouse Dress Skirt

10 8 10 10 8 10 8

If the =AVERAGE() function had been used the answer would have been : This figure is of no benefit to the shopkeeper as there are no garmets of this size!

9.7

INDEX

Values 7 4 25 8 16

Ranking Position High to Low 4 5 1 3 2 =RANK(C4,C4:C8) =RANK(C5,C4:C8) =RANK(C6,C4:C8) =RANK(C7,C4:C8) =RANK(C8,C4:C8)

Values 7 4 25 8 16

Ranking Position Low to High 2 1 5 3 4 =RANK(C11,C11:C15,1) =RANK(C12,C11:C15,1) =RANK(C13,C11:C15,1) =RANK(C14,C11:C15,1) =RANK(C15,C11:C15,1)

Values 10 30 20 30 40 What Does It Do ?

Ranking Position High to Low 5 2 4 2 1 =RANK(C18,C18:C22) =RANK(C19,C18:C22) =RANK(C20,C18:C22) =RANK(C21,C18:C22) =RANK(C22,C18:C22)

This function calculates the position of a value in a list relative to the other values in the list. A typical usage would be to rank the times of athletes in a race to find the winner. The ranking can be done on an ascending (low to high) or descending (high to low) basis. If there are duplicate values in the list, they will be assigned the same rank. Subsequent ranks would not follow on sequentially, but would take into account the fact that there were duplicates. If the numbers 30, 20, 20 and 10 were ranked, 30 is ranked as 1, both 20's are ranked as 2, and the 10 would be ranked as 4.
Value 30 20 20 10 Syntax Rank 1 2 2 4

=RANK(B34,B34:B37) =RANK(B35,B34:B37) =RANK(B36,B34:B37) =RANK(B37,B34:B37)

=RANK(NumberToRank,ListOfNumbers,RankOrder) The RankOrder can be 0 zero or 1. Using 0 will rank larger numbers at the top. (This is optional, leaving it out has the same effect).

Using 1 will rank small numbers at the top.


Formatting

No special formatting is needed.


Example

The following table was used to record the times for athletes competing in a race. The =RANK() function was then used to find their race positions based upon the finishing times.
Athlete John Alan David Brian Sue Alex Time 1:30 1:45 1:02 1:36 1:27 1:03 Race Position 4 6 1 5 3 2

=RANK(C53,C53:C58,1) =RANK(C54,C53:C58,1) =RANK(C55,C53:C58,1) =RANK(C56,C53:C58,1) =RANK(C57,C53:C58,1) =RANK(C58,C53:C58,1)

INDEX
Items To Test 500 800 500 25 25 500 12 What Does It Do? Result TRUE FALSE FALSE TRUE

=AND(C4>=100,D4>=100) =AND(C5>=100,D5>=100) =AND(C6>=100,D6>=100) =AND(D7>=1,D7<=52)

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.


Formatting

When used by itself it will show TRUE or FALSE.


Example 1

The following example shows a list of examination results. The teacher wants to find the pupils who scored above average in all three exams. The =AND() function has been used to test that each score is above the average. The result of TRUE is shown for pupils who have scored above average in all three exams.
Name Alan Bob Carol David Eric Fred Gail Harry Ian Janice Maths 80 50 60 90 20 40 10 80 30 10 English 75 30 70 85 30 60 90 70 10 20 Physics 85 40 50 95 Absent 80 80 60 20 30 Passed TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE FALSE

=AND(C38>=AVERAGE($C$29:$C$38),D38>=AVERAGE($D$29:$D$38),E38>=AVERAGE($E$29:$E$38))

Averages

47

54

60

INDEX
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. Formatting No special formatting is required. Example 1 The following table shows the Sales figures and Targets for sales reps. Each has their own target which they must reach. 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 Alan Bob Carol Sales 1000 6000 2000 Target 5000 5000 4000 Result Not achieved Achieved Not Achieved

=IF(C31>=D31,"Achieved","Not Achieved") =IF(C32>=D32,"Achieved","Not Achieved") =IF(C33>=D33,"Achieved","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 Alan Bob Carol Sales 1000 6000 2000 Target 5000 5000 4000 Commission 50 600 100

=IF(C43>=D43,C43*10%,C43*5%) =IF(C44>=D44,C44*10%,C44*5%) =IF(C45>=D45,C45*10%,C45*5%)

Example 3 Use of Nested IF statement The following table represents marks secured by 4 students in different subjects The student needs to be given grade based on the marks secured Grades are as follows; A : if the student scores 80 or above B : if the student scores 60 to 79

C : if the student scores 45 to 59 D : if the student scores 30 to 44 Fail : if the student scores below 30 Grades are required to be shown in the 'Result' table

Maths English Science History Geography

A 76 55 66 70 85

B 89 66 60 59 67

C 23 30 34 45 28

D 45 43 25 55 60

Result
Maths English Science History Geography A B C B B A B A B B C B C fail D D C fail D C D fail C B

Example 4 This example uses the =AND() within the =IF() function. A builders merchant gives 10% discount on certain product lines. The discount is only given on products which are on Special Offer, when the Order Value is 1000 or above. The =AND() function is used with the =IF() to check that the product is on offer and that the value of the order is above 1000. Product Wood Glass Cement Turf Special Offer Yes No Yes Yes Order Value 2,000 2,000 500 3,000 Discount 200 300 Total 1,800 2,000 500 2,700

=IF(AND(C61="Yes",D61>=1000),D61*10%,

D31,"Achieved","Not Achieved") D32,"Achieved","Not Achieved") D33,"Achieved","Not Achieved")

D43,C43*10%,C43*5%) D44,C44*10%,C44*5%) D45,C45*10%,C45*5%)

61="Yes",D61>=1000),D61*10%,0)

INDEX
Cells To Test 10 20 10 20 10 20 1-Jan-98 1-Feb-98 Hello Goodbye Hello Hello What Does It Do ? Result TRUE TRUE FALSE TRUE TRUE FALSE

=NOT(C4>D4) =NOT(C5=D5) =NOT(C6<D6) =NOT(C7>D7) =NOT(C8=D8) =NOT(C9=D9)

This function performs a test to see if the test fails. (A type of reverse logic). If the test fails, the result is TRUE. If the test is met, then the result is FALSE.
Syntax

=NOT(TestToPerform) The TestToPerform can be reference to cells or another calculation.


Formatting

No special formatting is needed.


Example

The following table was used by a library to track books borrowed. The date the book was Taken out is entered. The period of the Loan is entered. The date the book was returned is entered. The =NOT() function has been used to calculate whether the book was returned within the correct time, by adding the Loan value to the Taken date. If the book was not returned on time the result Overdue is shown, otherwise OK is shown.
Taken 1-Jan-98 1-Jan-98 1-Jan-98 Loan 14 14 14 Returned 5-Jan-98 15-Jan-98 20-Jan-98 Status OK OK Overdue

=IF(NOT(D33<=B33+C33),"Overdue","OK") =IF(NOT(D34<=B34+C34),"Overdue","OK") =IF(NOT(D35<=B35+C35),"Overdue","OK")

INDEX
Payment Type Cash Visa Cheque Delta Handling Charge =IF(OR(E4="Visa",E4="Delta"),5,0) 5 =IF(OR(E5="Visa",E5="Delta"),5,0) =IF(OR(E6="Visa",E6="Delta"),5,0) 5 =IF(OR(E7="Visa",E7="Delta"),5,0)

Order No. AB001 AB002 AB003 AB004 What Does It Do?

Cost 1000 1000 2000 5000

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 conditions. Normally the OR() function would be used in conjunction with a function such as =IF().
Syntax

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


Formatting

When used by itself it will show TRUE or FALSE.


Example

The following table shows a list of orders taken by a company. A handling charge of 5 is made on all orders paid by Visa or Delta cards. The =OR() function has been used to determine whether the charge needs to be applied.
Payment Type Cash Visa Cheque Delta Handling Charge 5 5 =IF(OR(E27="Visa",E27="Delta"),5,0)

Order No. AB001 AB002 AB003 AB004

Cost 1000 1000 2000 5000

INDEX IF,MAX,MIN, AND, OR Statements Customer Number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Customer Name Well & Good Staples and Clips Nature Works Candy Land Prime Brokerage Crumson & Smith Jane Wendall & Co. Wine and Cheese Clean & Tidy Cream & Spice Orange Markets Prime Shopping Good Works & Co. Willow Works Working Woman In a Moment, Inc. Andrew Macri Bravo Caf Order Number 11803-6827 36024-2407 15201-4134 82961-5746 86757-1970 45101-1900 59920-1055 63565-1426 15916-3107 40002-2226 72258-9485 76266-6624 19800-6050 22787-7678 35220-6145 82875-3558 14213-9073 94398-8057 Revenue 675 703 20,237 10,049 792 12,627 8,886 6,565 8,530 6,551 8,404 12,381 19,601 689 10,021 3,834 1,109 10,063 20,237 Profit 169 176 5,059 2,512 9 440 2,221 1,641 10 1,638 22 66 560 172 2,505 65 277 2,516 5,059 15177.52

Find the Cost = Maximum Revenue - Maximum Profit, considering that both the criteria given below are met. Criteria 1 - Maximum revenue in the range should be higher than the input value Criteria 1 - Maximum profit in the range should be higher than the input value

Criteria 1 Criteria 2 Cost

Revenue Input Profit Input 15177.52 <== Use a combination o IF(AND(MAX(D5:D22)>H27,MAX(E5:

Criteria 1 Find the Cost = Maximum Revenue - Maximum Profit, considering the following criteria considering that either Criteria 2 ofCriteria the criteria given below is met. Cost 1 - Maximum revenue in the range should be higher than the input value Criteria 1 - Maximum profit in the range should be higher than the input value

Revenue Input Profit Input 15177.52 <== Use a combination o

10000

1,000 <== Use a combination of IF, AND and MAX statements AX(D5:D22)>H27,MAX(E5:E22)>H28),MAX(D5:D22)-MAX(E5:E22),"")

300000 1,000 <== Use a combination of IF, OR and MAX statements

INDEX
Cell to test 3 #DIV/0! #NAME? #REF! #VALUE! #REF! #N/A What Does It Do ? Result FALSE TRUE TRUE TRUE TRUE TRUE TRUE

=ISERROR(D4) =ISERROR(D5) =ISERROR(D6) =ISERROR(D7) =ISERROR(D8) =ISERROR(D9) =ISERROR(D10)

This function tests a cell or calculation to determine whether an error has been generated. It will show TRUE for any type of error and FALSE if no error is found.
Syntax

=ISERROR(CellToTest) The CellToTest can be a cell reference or a formula.


Formatting

No special formatting is needed.


Example

The following tables was used to calculate the difference between two dates. Table 1 shows an error due to the fact that the first entry was entered using an inappropriate date format. Table 1
Start date : Jan 01 98 End date : 5-Jan-98 Difference : #VALUE! =D31-D30

Table 2 shows how the =ISERROR() function has been used to trap the error and inform the user that there has been an error in the data entry. Table 2
Start date : Jan 01 98 End date : 5-Jan-98 Difference : Error in data entry =IF(ISERROR(D40-D39),"Error in data entry",D40-D39)

INDEX
Cell Entry 1 1-Jan-98 #DIV/0! Hello What Does It Do ? Result TRUE TRUE FALSE FALSE FALSE

=ISNUMBER(D4) =ISNUMBER(D5) =ISNUMBER(D6) =ISNUMBER(D7) =ISNUMBER(D8)

This function examines a cell or calculation to determine whether it is a numeric value. If the cell or calculation is a numeric value the result TRUE is shown. If the cell or calculation is not numeric, or is blank, the result FALSE is shown.
Syntax

=ISNUMBER(CellToTest) The cell to test can be a cell reference or a calculation.


Formatting

No special formatting is needed.


Example

The following table was used by a personnel department to lookup the salary of an employee. The employee can be entered as a Name or as a Numeric value. The =ISNUMBER() function has been used to identify the type of entry made, and then the =IF() decides which VLOOKUP to perform.
ID No. 1 2 3 4 5 Name Alan Eric Carol Bob David Salary 10,000 12,000 8,000 15,000 12,000

Type Employee Name or ID : eric The Salary is : 12,000 =IF(ISNUMBER(E35),VLOOKUP(E35,C29:E33,3,FALSE),VLOOKUP(E35,D29:E33,2,FALSE))

INDEX
Cell To Test Hello 1 25-Dec-98 Result TRUE FALSE FALSE FALSE

=ISTEXT(D4) =ISTEXT(D5) =ISTEXT(D6) =ISTEXT(D7)

What Does It Do ?

This functions tests an entry to determine whether it is text. If the entry is text is shows TRUE. If the entry is any other type it shows FALSE.
Syntax

=ISTEXT(CellToTest)
Formatting

No special formatting is needed.


Example

The following table was used by a personnel department to lookup the salary of an employee. The employee can be entered as a Name or as a Numeric value. The =ISTEXT() function has been used to identify the type of entry made, and then the =IF() decides which VLOOKUP to perform.
ID No. 1 2 3 4 5 Name Alan Eric Carol Bob David Salary 10,000 12,000 8,000 15,000 12,000

Type Employee Name or ID : 3 The Salary is : 8,000 =IF(ISTEXT(E33),VLOOKUP(E33,D27:E31,2,FALSE),VLOOKUP(E33,C27:E31,3,FALSE))

INDEX
Data 1 Hello 25-Dec-98 What Does It Do? Is The Cell Blank FALSE FALSE TRUE FALSE

=ISBLANK(C4) =ISBLANK(C5) =ISBLANK(C6) =ISBLANK(C7)

This function will determine if there is an entry in a particular cell. It can be used when a spreadsheet has blank cells which may cause errors, but which will be filled later as the data is received by the user. Usually the function is used in conjunction with the =IF() function which can test the result of the =ISBLANK()
Syntax

=ISBLANK(CellToTest)
Formatting

Used by itself the result will be shown as TRUE or FALSE.


Example

The following example shows a list of cheques received by a company. When the cheque is cleared the date is entered. Until the Cleared date is entered the Cleared column is blank. While the Cleared column is blank the cheque will still be Outstanding. When the Cleared date is entered the cheque will be shown as Banked. The =ISBLANK() function is used to determine whether the Cleared column is empty or not.
Cheques Received Num From chq1 ABC Ltd chq2 CJ Design chq3 J Smith chq4 Travel Co. chq5 J Smith Date Received 1-Jan-98 1-Jan-98 2-Jan-98 3-Jan-98 4-Jan-98 Date Cleared 2-Jan-98 7-Jan-98

Amount 100 200 50 1,000 250

Banked Outstanding 100 0 200 0 0 50 0 1000 6-Jan-98 250 0 =IF(ISBLANK(F36),0,E36) =IF(ISBLANK(F36),E36,0) Totals 550 1050

INDEX
Number 1 2 2.5 2.6 3.5 3.6 Hello 1-Feb-98 1-Feb-96 Is it Odd TRUE FALSE FALSE FALSE TRUE TRUE #VALUE! TRUE FALSE

=ISODD(C4) =ISODD(C5) =ISODD(C6) =ISODD(C7) =ISODD(C8) =ISODD(C9) =ISODD(C10) =ISODD(C11) =ISODD(C12)

What Does It Do ?

This function tests a number to determine whether it is odd. An odd number is shown as TRUE an even number is shown as FALSE. Note that decimal fractions are ignored. Note that dates can be odd or even. Note that text entries result in the #VALUE! error.
Syntax

=ISODD(CellToTest)
Formatting

No special formatting is required.

INDEX
Number 1 2 2.5 2.6 3.5 3.6 Hello 1-Feb-98 1-Feb-96 Is it Even FALSE TRUE TRUE TRUE FALSE FALSE #VALUE! FALSE TRUE

=ISEVEN(C4) =ISEVEN(C5) =ISEVEN(C6) =ISEVEN(C7) =ISEVEN(C8) =ISEVEN(C9) =ISEVEN(C10) =ISEVEN(C11) =ISEVEN(C12)

What Does It Do ?

This function tests a number to determine whether it is even. An even number is shown as TRUE an odd number is shown as FALSE. Note that decimal fractions are ignored. Note that dates can be even or odd. Note that text entries result in the #VALUE! error.
Syntax

=ISEVEN(CellToTest)
Formatting

No special formatting is required.

INDEX
Number 1 Hello 1-Jan-98 #REF! Result FALSE FALSE FALSE FALSE FALSE

=ISNA(C4) =ISNA(C5) =ISNA(C6) =ISNA(C7) =ISNA(C8)

What Does It Do?

This function tests a cell to determine whether it contains the Not Available error #N/A. The #N/A is generated when a function cannot work properly because of missing data. The #N/A can also be typed in to a cell by the user to indicate the cell is currently empty, but will be used for data entry in the future. The function is normally used with other functions such as the =IF() function.
Syntax

=ISNA(CellToTest)
Formatting

No special formatting is needed.

INDEX
Name Alan Bob Carol David Eric Francis Gail Jan 10 20 30 40 50 60 70 Feb 80 90 100 110 120 130 140 Eric 77 =LOOKUP(F12,D4:G10) Mar 97 69 45 51 77 28 73

Type a Name in this cell : The March value for this person is : What Does It Do ?

This function looks for a piece of information in a list, and then picks an item from the last cell in the adjacent row or column. It always picks the data from the end of the row or column, so it is no good if you need to pick data from part way across a list, (use VLOOKUP or HLOOKUP). The way in which the function decides whether to pick from the row or column is based on the size of the table. If the table has more rows than columns : the function will look down the left most column trying to find a match for the piece of information you asked it to look for. When a match is found, the function will look across to the right most column to pick the last entry on the row.

If the table has the same amount of rows and columns : the function will look down the left most column and work in just the same way as if the table had more rows than columns, as in the description above. If the table has more columns than rows : the function will look across the top row trying to find a match for the piece of information you have asked it to look for. When a match is found, the function will then look down to the bottom cell of the column to pick the last entry of the column.

Syntax

=LOOKUP(WhatToLookFor,RangeToLookIn)

The WhatToLookFor should be a single item. The RangeToLook in can be either horizontal or vertical. Be careful not to include unnecessary heading in the range as these will cause errors.
Example 1 Example 2

In this table there are more rows than columns, so the column heading of Jan is not included in the lookup range.
Jan Alan Bob Carol David Eric Fred Formatting 100 100 100 100 100 100

In this table there are more columns than rows, so the row heading of Jan is not included in the lookup range.
Alan 100 Bob 100 Carol 100 David 100

Jan

No special formatting is needed.


Problems

The list of information to be looked through must be sorted in ascending order, otherwise errors will occur, either as #N/A or incorrect results. Table 1 shows the Name column sorted alphabetically, the results of using =LOOKUP() will be correct. Table 2 shows the same data, but not sorted. Sometimes the results will be correct, but other times the result will be an #N/A error or incorrect figure.
Table 1 Name Alan Bob Carol David Eric Francis Gail Name : Value : Table 2 Name David Eric Alan Bob Carol Francis Gail Name : Value :

Jan 10 20 30 40 50 60 70 Eric

Feb 80 90 100 110 120 130 140

Mar 97 69 45 51 77 28 73

Jan 40 50 10 20 30 60 70 Eric

Feb 110 120 80 90 100 130 140

Mar 51 77 97 69 45 28 73

77 =LOOKUP(C88,B80:E86)

45 =LOOKUP(H88,G80:J86)

INDEX
VLOOKUP
The column numbers are not needed. they are part of the illustration. col 1 col 2 col 3 col 4 col 5 col 6

Jan Feb Mar

10 80 97

20 90 69

30 100 45

40 110 51

50 120 77

Type a month to look for : Which column needs to be picked out : The result is :

Feb 4 100

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,ExactMatchOrApproximateMatch) 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. Formatting No special formatting is needed. Example 1 This table is used to find a value based on a specified name and month. The =VLOOKUP() is used to scan down to find the name. The problem arises when we need to scan across to find the month column. To solve the problem the =MATCH() function is used. The =MATCH() looks through the list of names to find the month we require. It then calculates the position of the month in the list. Unfortunately, because the list of months is not as wide as the lookup range, the =MATCH() number is 1 less than we require, so and extra 1 is added to compensate. The =VLOOKUP() now uses this =MATCH() number to look across the columns and picks out the correct cell entry.

Bob Eric Alan Carol David

Jan 10 20 30 40 50

Feb 80 90 100 110 120

Mar 97 69 45 51 77 BOB JAN 10

Type a name to look for :

Type a month to look for : The result is :

Example 2 This example shows how the =VLOOKUP() is used to pick the cost of a spare part for different makes of cars. The =VLOOKUP() scans down row headings in column F for the spare part entered in column C. When the make is found, the =VLOOKUP() then scans across to find the price, using the result of the =MATCH() function to find the position of the make of car. The functions use the absolute ranges indicated by the dollar symbol . This ensures that when the formula is copied to more cells, the ranges for =VLOOKUP() and =MATCH() do not change. Maker Vauxhall VW Ford VW Ford Ford Vauxhall Ford Spare Ignition INR GearBox INR Engine INR Steering INR Ignition INR CYHead INR GearBox INR Engine INR Cost 50 600 1,200 275 70 290 500 1,200 Lookup Table GearBox Engine Steering Ignition CYHead Vauxhall 500 1000 250 50 300 Ford 450 1200 350 70 290 VW 600 800 275 45 310

Example 3 In the following example a builders merchant is offering discount on large orders. The Unit Cost Table holds the cost of 1 unit of Brick, Wood and Glass. The Discount Table holds the various discounts for different quantities of each product. The Orders Table is used to enter the orders and calculate the Total. All the calculations take place in the Orders Table. The name of the Item is typed in column C of the Orders Table. The Unit Cost of the item is then looked up in the Unit Cost Table. The FALSE option has been used at the end of the function to indicate that the product names down the side of the Unit Cost Table are not sorted. Using the FALSE option forces the function to search for an exact match. If a match is not found, the function will produce an error. =VLOOKUP(C126,C114:D116,2,FALSE) The discount is then looked up in the Discount Table If the Quantity Ordered matches a value at the side of the Discount Table the =VLOOKUP will look across to find the correct discount. The TRUE option has been used at the end of the function to indicate that the values down the side of the Discount Table are sorted. Using TRUE will allow the function to make an approximate match. If the Quantity Ordered does not match a value at the side of the Discount Table, the next lowest value is used. Trying to match an order of 125 will drop down to 100, and the discount from

the 100 row is used. =VLOOKUP(D126,F114:I116,MATCH(C126,G113:I113,0)+1,TRUE) Discount Table Brick Wood 0% 0% 6% 3% 8% 5%

Unit Cost Table Brick 2 Wood 1 Glass 3

Qty. 1 100 300

Glass 0% 12% 15%

Item Brick Wood Glass Brick Wood Glass

Units 100 200 150 225 50 500

Orders Table Unit Cost 2 1 3 2 1 3

Discount 6% 3% 12% 6% 0% 15%

Total 188 194 396 423 50 1,275

umbers are not needed.

of the illustration.

INDEX
Jan 10 20 30 40 50 Feb 80 90 100 110 120 Mar 97 69 45 51 77 Feb 4 100 =HLOOKUP(F10,D3:F10,F11,FALSE)
row 1 row 2 row 3 row 4 row 5 row 6 The row numbers are not needed. they are part of the illustration.

Type a month to look for : Which row needs to be picked out : The result is : What Does It Do ?

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

=HLOOKUP(ItemToFind,RangeToLookIn,RowToPickFrom,SortedOrUnsorted) The ItemToFind is a single item specified by the user. The RangeToLookIn is the range of data with the column headings at the top. The RowToPickFrom is how far down the column the function should look to pick from. The Sorted/Unsorted is whether the column headings are sorted. TRUE for yes, FALSE for no.
Formatting

No special formatting is needed.


Example 1

This table is used to find a value based on a specified month and name. The =HLOOKUP() is used to scan across to find the month. The problem arises when we need to scan down to find the row adjacent to the name. To solve the problem the =MATCH() function is used. The =MATCH() looks through the list of names to find the name we require. It then calculates the position of the name in the list. Unfortunately, because the list of names is not as deep as the lookup range, the =MATCH() number is 1 less than we require, so and extra 1 is added to compensate. The =HLOOKUP() now uses this =MATCH() number to look down the month column and picks out the correct cell entry. The =HLOOKUP() uses FALSE at the end of the function to indicate to Excel that the column headings are not sorted, even though to us the order of Jan,Feb,Mar is correct. If they were sorted alphabetically they would have read as Feb,Jan,Mar.

Bob Eric Alan Carol David

Jan 10 20 30 40 50

Feb 80 90 100 110 120

Mar 97 69 45 51 77 feb alan

Type a month to look for : Type a name to look for :

The result is : 100 =HLOOKUP(F54,D47:F54,MATCH(F55,C48:C52,0)+1,FALSE) Example 2

This example shows how the =HLOOKUP() is used to pick the cost of a spare part for different makes of cars. The =HLOOKUP() scans the column headings for the make of car specified in column B. When the make is found, the =HLOOKUP() then looks down the column to the row specified by the =MATCH() function, which scans the list of spares for the item specified in column C. The function uses the absolute ranges indicated by the dollar symbol $. This ensures that when the formula is copied to more cells, the ranges for =HLOOKUP() and =MATCH() do not change.
Maker Vauxhall VW Ford VW Ford Ford Vauxhall Ford Spare Ignition GearBox Engine Steering Ignition CYHead GearBox Engine Cost 50 600 1,200 275 70 290 GearBox Engine Steering Ignition CYHead Vauxhall 500 1000 250 50 300 Ford 450 1200 350 70 290 VW 600 800 275 45 310

500 1,200 =HLOOKUP(B79,G72:I77,MATCH(C79,F73:F77,0)+1,FALSE)

Example 3

In the following example a builders merchant is offering discount on large orders. The Unit Cost Table holds the cost of 1 unit of Brick, Wood and Glass. The Discount Table holds the various discounts for different quantities of each product. The Orders Table is used to enter the orders and calculate the Total. All the calculations take place in the Orders Table. The name of the Item is typed in column C. The Unit Cost of the item is then looked up in the Unit Cost Table.

The FALSE option has been used at the end of the function to indicate that the product names across the top of the Unit Cost Table are not sorted. Using the FALSE option forces the function to search for an exact match. If a match is not found, the function will produce an error. =HLOOKUP(C127,E111:G112,2,FALSE) The discount is then looked up in the Discount Table If the Quantity Ordered matches a value at the top of the Discount Table the =HLOOKUP will look down the column to find the correct discount. The TRUE option has been used at the end of the function to indicate that the values across the top of the Discount Table are sorted. Using TRUE will allow the function to make an approximate match. If the Quantity Ordered does not match a value at the top of the Discount Table, the next lowest value is used. Trying to match an order of 125 will drop down to 100, and the discount from the 100 column is used. =HLOOKUP(D127,E115:G118,MATCH(C127,D116:D118,0)+1,TRUE)
Unit Cost Table Wood Glass 1 3

Brick 2

Brick Wood Glass

Discount Table 1 100 0% 6% 0% 3% 0% 12% Orders Table Unit Cost Discount 2 6% 1 3% 3 12% 2 6% 1 0% 3 15%

300 8% 5% 15%

Item Brick Wood Glass Brick Wood Glass

Units 100 200 150 225 50 500

Total 188 194 396 423 50 1,275

Unit Cost Discount

=HLOOKUP(C127,E111:G112,2,FALSE) =HLOOKUP(D127,E115:G118,MATCH(C127,D116:D118,0)+1,TRUE)

INDEX
Index Value 1 3 2 3 1 2

Result Alan Carol Bob 18% 10% 15%

=CHOOSE(C4,"Alan","Bob","Carol") =CHOOSE(C5,"Alan","Bob","Carol") =CHOOSE(C6,"Alan","Bob","Carol") =CHOOSE(C7,10%,15%,18%) =CHOOSE(C8,10%,15%,18%) =CHOOSE(C9,10%,15%,18%)

What Does It Do?

This function picks from a list of options based upon an Index value given to by the user.
Syntax

=CHOOSE(UserValue, Item1, Item2, Item3 through to Item29)


Formatting

No special formatting is required.


Example

The following table was used to calculate the medals for athletes taking part in a race. The Time for each athlete is entered. The =RANK() function calculates the finishing position of each athlete. The =CHOOSE() then allocates the correct medal. The =IF() has been used to filter out any positions above 3, as this would cause the error of #VALUE to appear, due to the fact the =CHOOSE() has only three items in it.
Name Alan Bob Carol David Eric Time 1:30 1:15 2:45 1:05 1:20 Position Medal 2 Silver =IF(D30<=3,CHOOSE(D30,"Gold","Silver","Bronze"),"unplaced") 4 unplaced =IF(D31<=3,CHOOSE(D31,"Gold","Silver","Bronze"),"unplaced") 1 Gold =IF(D32<=3,CHOOSE(D32,"Gold","Silver","Bronze"),"unplaced") 5 unplaced =IF(D33<=3,CHOOSE(D33,"Gold","Silver","Bronze"),"unplaced") 3 Bronze =IF(D34<=3,CHOOSE(D34,"Gold","Silver","Bronze"),"unplaced") =RANK(C34,C30:C34)

INDEX
MATCH() Names Bob Alan David Carol Type a name to look for : The position of Alan is : Alan 2 Type a value : Value position : Values 250 600 1000 4000 1000 3

What Does It Do ? This function looks for an item in a list and shows its position. It can be used with text and numbers. It can look for an exact match or an approximate match. Syntax =MATCH(WhatToLookFor,WhereToLook,TypeOfMatch) The TypeOfMatch either 0, 1 or -1. Using 0 will look for an exact match. If no match is found the #NA error will be shown. Using 1 will look for an exact match, or the next lowest number if no exact match exists. If there is no match or next lowest number the error #NA is shown. Using -1 will look for an exact match, or the next highest number if no exact match exists. If there is no exact match or next highest number the error #NA is shown. Examples 1 Using the 0 option suitable for an exact match. The Ascending list gives the exact match. The Descending list gives the exact match. The Wrong Value list cannot find an exact match, so the #NA is shown. A 10 20 30 40 20 2 B 40 30 20 10 20 3 C 10 20 30 40 25 #N/A

Example 2 Using the 1 option to find an exact or next lowest match. A 10 B 10

20 30 40 20 2

20 30 40 29 2

Example 3 Using the -1 option to find an exact or next highest match. A 40 30 20 10 20 3 B 40 30 20 10 25 2

INDEX
Holiday booking price list. People Weeks 1 2 3 1 500 600 700 2 300 400 500 3 250 300 350 4 200 250 300 2 4 250 =INDEX(D7:G9,G11,G12)

How many weeks required : How many people in the party : Cost per person is : What Does It Do ?

This function picks a value from a range of data by looking down a specified number of rows and then across a specified number of columns. It can be used with a single block of data, or non-continuos blocks.
Syntax

There are various forms of syntax for this function.


Syntax 1

=INDEX(RangeToLookIn,Coordinate) This is used when the RangeToLookIn is either a single column or row. The Co-ordinate indicates how far down or across to look when picking the data from the range. Both of the examples below use the same syntax, but the Co-ordinate refers to a row when the range is vertical and a column when the range is horizontal.
Colours Red Green Blue Type either 1, 2 or 3 : 2 The colour is : Green =INDEX(D32:D34,D36) Syntax 2

Size

Large

Medium

Small

Type either 1, 2 or 3 : 2 The size is : Medium =INDEX(G34:I34,H36)

=INDEX(RangeToLookIn,RowCoordinate,ColumnColumnCordinate) This syntax is used when the range is made up of rows and columns.
Country England France Germany Currency Population Sterling 50 M Franc 40 M DM 60 M Capitol London Paris Bonn

Spain

Peseta

30 M

Barcelona 2 3 Paris =INDEX(D45:F48,F50,F51)

Type 1,2,3 or 4 for the country : Type 1,2 or 3 for statistics : The result is :

Syntax 3

=INDEX(NamedRangeToLookIn,RowCoordinate,ColumnColumnCordinate,AreaToPickFrom) Using this syntax the range to look in can be made up of multiple areas. The easiest way to refer to these areas is to select them and give them a single name. The AreaToPickFrom indicates which of the multiple areas should be used. In the following example the figures for North and South have been named as one range called NorthAndSouth.
NORTH Bricks Wood Glass SOUTH Bricks Wood Glass Qtr1 1,000 5,000 9,000 Qtr1 1,500 5,500 9,500 Qtr2 2,000 6,000 10,000 Qtr2 2,500 6,500 10,500 Qtr3 3,000 7,000 11,000 Qtr3 3,500 7,500 11,500 1 3 2 3500 =INDEX(NorthAndSouth,F76,F77,F78) Qtr4 4,000 8,000 12,000 Qtr4 4,500 8,500 12,500

Type 1, 2 or 3 for the product : Type 1, 2, 3 or 4 for the Qtr : Type 1 for North or 2 for South : The result is :

Example

This is an extended version of the previous example. It allows the names of products and the quarters to be entered. The =MATCH() function is used to find the row and column positions of the names entered. These positions are then used by the =INDEX() function to look for the data.
EAST Bricks Wood Glass Qtr1 1,000 5,000 9,000 Qtr2 2,000 6,000 10,000 Qtr3 3,000 7,000 11,000 Qtr4 4,000 8,000 12,000

WEST Bricks Wood Glass

Qtr1 1,500 5,500 9,500

Qtr2 2,500 6,500 10,500

Qtr3 3,500 7,500 11,500 wood qtr2 west 6500

Qtr4 4,500 8,500 12,500

Type 1, 2 or 3 for the product : Type 1, 2, 3 or 4 for the Qtr : Type 1 for North or 2 for South : The result is :

=INDEX(EastAndWest,MATCH(F100,C91:C93,0),MATCH(F101,D90:G90,0),IF(F102=C90,1,IF(F102=C95,2)))

INDEX
Cell to test A B C D E F G What Does It Do ? Result 4 5 6 7 4 4 4 =ROW(D4) =ROW(D5) =ROW(D6) =ROW(D7) =COLUMN(D8) =COLUMN(D8) =COLUMN(D8)

ROW function tells you the current row number COLUMN function tells you the current column number
Syntax

=ROW(CellToTest) =COLUMN(Cell to Test)


Formatting

No special formatting is needed.

You might also like