You are on page 1of 33

If you've been using Excel 2003 for several months or years, you will probably have recently become

aware of increasing numbers of people or organisations using Excel 2007. You may even have been sent Excel 2007 workbooks that you can't open with your own version of Excel. Whatever your current awareness of Excel 2007, it is likely that you will, at some point in the future, consider taking the plunge and switching to Excel 2007. But what are the main benefits of switching, and how much effort will be involved?

Number of Rows and Columns


One of the main developments in Excel 2007 is that it allows more columns and rows. For many users this may not be an issue - after all, the 65,536 rows and 256 columns provided by Excel 2003 allows you to handle a large amount of data. However, it isn't so unusual for users to want to handle HUGE amounts of data! Therefore Excel 2007's ability to handle 1,048,576 rows and 16,384 columns of data is a great advantage for some users.

Conditional Formatting
Another major improvement in Excel 2007 is Conditional formatting. I have frequently been asked, by colleagues using Excel 2003, about applying more than 3 conditional formats. Up until recently, I have always had to explain that this is a limitation of Excel 2003, but now, in Excel 2007, a user can specify as many conditions as they like, each with a different format.

Conditional formatting in Excel 2007 can even be made to work for cells that satisfy more than one condition. For example, if you specify cells having values 10 to have bold text and cells having values 10 to have red text, you will find that text in cells containing values exactly equal to 10 will be formatted as bold AND red.

Also, Excel 2007 offers additional types of conditional formatting. If your bosses (like mine) like to see figures illustrated with pretty charts and lots of colour, they will love the spreadsheets you produce with Excel's new Data Bars, Color Scales & Icon Sets! These features apply colour or symbols to a range of cells, depending upon each cell's value in relation to the rest of the cells in the selected range. As an example, the image on the right shows conditional formatting Data Bars, Color Scales & Icon Sets, applied to 3 columns, each containing the numbers 1 - 10. As a final bonus, Excel 2007 also now enables conditional formatting to be used with pivot tables. At first, the interface to Excel 2007 conditional formatting can appear to be a bit complicated, but the time spent familiarising yourself with this functionality is well worth the investment! Click here for details of how to use Excel Conditional Formatting

Filtering and Sorting by Colour


In Excel 2003, Filtering and Sorting could be performed by cell values only. However, in Excel 2007, you can now filter and sort by colour. This can be either the font colour or the cell background colour.

Function Nesting Limitations


In my opinion, one of the most useful improvements in Excel 2007 is the level of nesting that can be performed. Excel 2003 only allows 7 levels of nesting of functions, while Excel 2007 allows up to 64. Surely, even the most dedicated Excel user cannot possibly need more nesting levels than that!

Resizeable Formula Bar

In Excel 2003, if a cell contained a long formula or text string, when the cell was selected, the view of the formula bar would block some of your spreadsheet. This was slightly inconvenient. However, Microsoft have addressed this problem in Excel 2007, by introducing a resizeable formula bar, which extends in line with your cell contents. This is shown in the image above.

New Functions
Excel 2007 contains a number of new built-in functions to help you to make your spreadsheet slicker and more efficient. These include the IFERROR Function, the SUMIFS function, and the new statistical AVERAGEIF, AVERAGEIFS, and COUNTIFS functions.

Increased Memory and Faster Calculations


My work has frequently been slowed down, when applying functions to large datasets in Excel 2003. I have often pasted a formula down every row of a spreadsheet, and then had to sit back and wait for Excel to calculate the formula results. However, this has improved in in Excel 2007, as memory management has been increased from 1 gigabyte to 2 gigabytes and complex calculations are now faster.

Charting
There have been some issues with the updating of charts in Excel 2007, which is slower than in Excel 2003. Also, the recording of macros involving charts sometimes doesn't work! For me personally, this isn't a great issue. However, if you frequently perform chart updates, or like to record macros involving charts, you should test drive Excel 2007 before committing to it. A free trial can be downloaded from the Microsoft Office Online website (opens in a new window).

New User Interface


The main user interface has been restructured in Excel 2007, into what Microsoft describe as a "results-oriented" interface. However, if you have been using Excel 2003 for several years, and know exactly where to find the tools functionality that you regularly use, there will almost certainly be a certain amount of frustration to begin with. My advice is ...

Persevere! ... it really is worth the effort! Like anything, once you get used to it, negotiating the new user interface will become second nature to you!
Basic Description
The Excel ABS function returns the absolute value (ie. the modulus) of any supplied number. The format of the Abs function is :

ABS( Number )

where the Number argument is any numerical value and can be supplied to the function as either a simple number, a reference to a cell containing a number, or as a numeric value returned from another function.

Examples
The following spreadsheets show simple examples of the Excel Abs function. The format of the function is shown in the spreadsheet on the left and the results are shown in the spreadsheet on the right. Formulas Results

Basic Description
The Excel REPLACE function replaces all or part of a text string with another string. The format of the function is :

REPLACE( Old_text, Start_num, Num_Chars, New_text )

Where the arguments are as follows : Old_text Start_num The original text string to be searched for The number of the character in the search string from which to start replacing text The number of characters to replace

Num_char

s New_text The replacement text

The Excel Replace function is similar to the Excel Substitute Function, but the Replace function replaces text in a specified position of a supplied string, while the Substitute function replaces one or more instances of a given text string. Note that the Excel Replace Function is not suitable for languages that use the double-byte character set (eg. Chinese, Japanese, Korean). These languages should use the ReplaceB function, which is explained on the official Microsoft website

Example
The following spreadsheets show examples of use of the Excel Replace Function. The spreadsheet on the left shows the format of the functions and the spreadsheet on the right shows the results.
Formulas Result

Basic Description
The Excel SUBSTITUTE function replaces occurrences of a search text string, within an original text string, with the supplied replacement text The format of the function is :

SUBSTITUTE( Text, Old_text, New_text, [Instance_Num] )

Where the arguments are as follows : Text Old_text New_text The original text string containing the text to be replaced The text to be found and replaced by New_text The new text that is used to replace the Old_text

[Instance_Num ]

An optional argument which specifies which occurrence of Old_text should be replaced by the New_text. If Instance_Num is specified, just that instance of the Old_text is replaced; Otherwise, all instances of Old_text are replaced with the New_text

Note that the Excel Substitute function is similar to the Excel Replace Function, but the Substitute function replaces one or more instances of a given text string, while the Replace function replaces text in a specified position of a supplied string.

Example
The spreadsheets on the right show examples of use of the Excel Substitute Function. The spreadsheet at the top shows the format of the functions and the spreadsheet below shows the results. Formulas

Results

The Excel CONCATENATE function joins together up to 30 supplied text strings. The format of the function is:

CONCATENATE( text1, text2, ... )

where the arguments, text1, text2, etc, can be text strings, numbers or single cell references.

Example

The example below shows the function being used to 'CONCATENATE' the text strings in columns A & B of the example spreadsheet. A 1 Name 2 Jane SMITH 3 Dominic DAY 4 James KAY B C D

Age DOB 24 35 21

Combined Details

29/02/84=CONCATENATE(A2,", Age ",B2) 31/05/73=CONCATENATE(A3,", DOB: ",C3) 02/02/87=CONCATENATE(A4,", DOB: ",TEXT(C4,"dd/mm/yy"))

Note that, in the example above, text blocks have been added to separate the different fields. For example, in cell D2, the text block ", Age " has been used to separate the name and age. Also note that in cell D3, the DOB is shown as the number 26815. This is because dates (and times) in Excel are represented as numbers. It is only the formatting of cells that makes dates appear in the date format. The number 26815 is the numeric value associated with the date 31st May 1973 and so this is the value that the function retrieves from cell C3. In cell D4, the date of birth is displayed in a date format. This has been done with the use of the TEXT function, which is used to translate the number 26815 into a text string in the date format "dd/mm/yy". The spreadsheet below shows the results of the three CONCATENATE functions in cells D2 - D4. A 1 Name 2 Jane SMITH 3 Dominic DAY 4 James KAY B C D

Age DOB 24 35 21

Combined Details

29/02/84Jane SMITH, Age 24 31/05/73Dominic DAY, DOB: 26815 02/02/87James KAY, DOB: 02/02/87

Basic Description
The Excel SEARCH function returns the position of a specified character or string within a supplied text string. The function is not case-sensitive. The format of the function is:

SEARCH(search_text, within_text, [start_num])


where the arguments are as follows: search_text the character or string that you wish to search for

within_text start_num

the original text, that should be searched the character number from which the search should begin

Note: This function is NOT case-sensitive. If you want a case-sensitive search, try the FIND function. The SEARCH function will return an error if the supplied search_text is not found. If the supplied search_text is found, the function returns a number, representing the position of the search_text in the within_text string.

Example
The following example shows the Excel SEARCH function applied to the values in cells B1 - B4 of the example spreadsheet. A B C

'SEARCH' for the letter "t", with the start_num 1 argument unspecified (default value = 1): Original Text 'SEARCH' for the letter "i", with the start_num 2 argument unspecified (default value = 1): Original Text 'SEARCH' for the letter "i", with the start_num 3 argument set to 4: Original Text 'SEARCH' for string "in", with the start_num 4 argument unspecified (default value = 1):

=SEARCH("t",B1)

=SEARCH("i",B2)

=SEARCH("i",B3, 4)

Original Text

=SEARCH("in",B4)

The results of the 4 calls to 'SEARCH' are shown in the spreadsheet below. A B C

'SEARCH' for the letter "t", with the start_num 1 argument unspecified (default value = 1): Original Text 'SEARCH' for the letter "i", with the start_num 2 argument unspecified (default value = 1): Original Text 'SEARCH' for the letter "i", with the start_num 3 argument set to 4: Original Text 'SEARCH' for string "in", with the start_num 4 argument unspecified (default value = 1):

10

Original Text

Note that, in the first example, the search function returns the position of the upper case "T", even though the search_text is a lower case "t".

Also note the third example (in cell C3), in which the start_num is set to 4. In this case the search begins at the fourth character of the within_text string. Therefore, the result returned is position 5.

Example 2 - Use SEARCH to Pick Out Cells Containing Specific Text


The following example shows the Excel SEARCH function used to highlight cells containing a specific text string. Imagine you have a spreadsheet showing members of staff alongside a list of skills. You want to pick out the rows containing members of staff who have typing skills. One way to do this is to use the SEARCH function to search for the word "Typing" in the 'Skills' column. This is shown in the spreadsheet below. A 1 Name 2 Jane SMITH 3 Julie KENNEDY Skills Shorthand, Typing, Visual Basic, Excel Presentation Skills, Management Training B Typing =SEARCH(C$1,B2) =SEARCH(C$1,B3) =SEARCH(C$1,B4) =SEARCH(C$1,B5) C

4 DOMINIC TAYLOR Microsoft Office, typing 5 James COOPER Typing, HTML Programming

Note: The $ symbol used in the term C$1 in the example above prevents the reference to cell C1 from automatically changing to C2, C3, etc as the formula is copied down to other cells.

Note that, in the example above, the search_text is set to C$1, (ie. the string "Typing"). When the string "Typing" is found, the function returns the position of the start of this string within the searched cell. If the string "Typing" is not found, the function returns an error.

A 1 Name 2 Jane SMITH 3 Julie KENNEDY Skills

B Typing

Shorthand, Typing, Visual Basic, Excel Presentation Skills, Management Training #VALUE!

12

4 DOMINIC TAYLOR Microsoft Office, typing 5 James COOPER Typing, HTML Programming

19 1

Note that the SEARCH function 'searches' for the string "typing" within cell B4, even though it begins with a lower case "t". This is because the Excel SEARCH function is not case sensitive. If you need to do a case-sensitive search, you should use Excel's FIND function. You might want to tidy up the results of the function in the example above. This can be done using the IF and ISERROR functions. For example, the formula in cell C2 could be written as =IF(ISERROR(SEARCH(C$1, B2)),0,1) This would return the value "1" if the text "Typing" was found in cell B2 and "0" otherwise.

Basic Description
The Excel IF function tests a user-defined condition and returns one result if the condition is true, and another result if the condition is false. The format of the function is:

IF( logical_test, value_if_true, value_if_false )

where the arguments are as follows: logical_test The user-defined condition that is to be tested and evaluated as either TRUE or FALSE The result that is to be returned from the function if the supplied logical_test evaluates to TRUE The result that is to be returned from the function if the supplied logical_test evaluates to FALSE

value_if_true

value_if_false

Nesting the Excel If Function


The If function is frequently 'nested' in Excel. I.e. the value_if_true or the value_if_false argument is replaced with another call to the If function (see Example 3 below). Excel 2003 allows up to 7 levels of nested If functions, but Excel 2007 and Excel 2010 allow up to 64 levels of nesting. For Example, the following formula (which has 8 levels of nesting), will result in an error in Excel 2003 but will work correctly in Excel 2007 or Excel 2010 : =IF(A1=1,"red", IF(A1=2,"blue", IF(A1=3,"green", IF(A1=4,"brown", IF(A1=5,"purple", IF(A1=6,"orange", IF(A1=7,"yellow", IF(A1=8,"grey", IF(A1=9,"pink", "black" ) ) ) ) ) ) ) ) )

If you do find yourself using multiple levels of nesting, you should probably consider other Excel functions that can be used to obtain the same result more succinctly. For example, the above function could be made much simpler by using the Excel Choose function.

If Function Example 1
The following example shows the Excel If function applied to two sets of numbers. In this example, the logical_test checks whether the corresponding value in column B is equal to 0, and the function returns :

or

The text string "div by zero" if the value in column B is equal to 0

The value in column A divided by the value in column B if the value in column B is not equal to zero

If Function Example 2
The logical_test within the Excel If function can be any type of expression that returns a TRUE or FALSE result. The following example shows some more examples of the function, using different types of logical_test.

If Function Example 3
The following example shows nesting of the Excel If function. The outer function has the same logical_test as in Example 1 above. However, in the example, the value_if_true argument is a further If function. Therefore:

If the value in column B is equal to 0, a further call to 'If' is made, to test the value in column C If the value in column B is not equal to zero, the function returns the value in column A divided by the value in column B

The Excel TRUE function simply returns the logical value True. The function takes no arguments and therefore, the format is simply:

TRUE()
Throughout your spreadsheet, instead of calling the TRUE function, you can simply type the text True into your spreadsheet, and Excel will interpret this as the logical value True.

The Excel FALSE function simply returns the logical value False. The function takes no arguments and therefore, the format is simply:

FALSE()
Throughout your spreadsheet, instead of calling the FALSE function, you can simply type the text False into your spreadsheet, and Excel will interpret this as the logical value False. The Excel DATE function, when supplied with integers representing a year, month and day, returns an Excel date. The format of the function is:

DATE( year, month, day )

where the year, month and day arguments can be supplied as integers or as references to cells containing integers.

Example
The following spreadsheet shows the function applied to 3 different data sets:

The resulting three dates are shown in the spreadsheet below (in the date format dd/mm/yyyy). Note that the last example, shown in cell D4, also makes use of the LEFT function, to extract the day number, 21, from the cell A4. Even though the LEFT function returns a string (rather than an integer), Excel is able to convert this string into a number, during its calculation of the DATE.

The DATE Function In VBA


There is also a built-in DATE function in VBA (used for writing Excel Macros). However, in VBA, this function has a different purpose to the spreadsheet DATE function. In VBA, the DATE function takes no parameters, and simply returns the current date. This is shown in the example below:
Dim CurrDate CurrDate = Date() As Date

After running the above snippet of VBA code, the variable 'CurrDate' is set to the current date.

The Excel TIME function, takes three integer arguments representing hours, minutes and seconds, and returns an Excel time. The format of the function is:

TIME( Hour, Minute, Second )

where the Hour, Minute and Second arguments can be supplied to the function directly, as integers, or as references to cells containing integers. The time that is returned from the Excel TIME function is stored by Excel as a decimal number, as is the case for all Excel times (this is explained further in the page on Excel Dates & Times). Therefore, it is important to make sure that your cell is formatted to a 'Time' format, if you want to easily make sense of the function result.

Example
The following spreadsheet shows several different examples of the TIME function. The format of the function is shown in the spreadsheet on the left and the results are shown in the spreadsheet on the right :

The results in column E of the spreadsheet above, are formatted with the Time format hh:mm:ss. Also note that, in cell E4, of the example above, the seconds argument is 73. However, the TIME function is able to convert this into 1 minute and 13 seconds.

The TIME Function In VBA


There is also a built-in TIME function in VBA (used for writing Excel Macros). However, in VBA, this function has a different purpose to the spreadsheet TIME function. In VBA, the TIME function takes no parameters, and simply returns the current time. This is shown in the example below:
Dim CurrTime CurrTime = Time() As Date

After running the above snippet of VBA code, the variable 'CurrTime' is set to the current time (note that in VBA, times are stored as a part of the 'Date' data type).

The Excel NOW function returns the current date and time. The function has no arguments and therefore, the format of the function is: NOW()

The NOW function updates every time your Excel worksheet is refreshed, and so any cells containing the function will be continually changing.

Example
The following example shows use of the NOW function, combined with the IF function, to highlight when an appointment is due. The function format is shown in the first spreadsheet and the results at 2 different times are shown in the two spreadsheets underneath.

Spreadsheet Showing Formula

Result at 15:59hrs on 16/11/2008

Result at 16:01hrs on 16/11/2008 In the above example, the current time (returned by the NOW function) is subtracted from the appointment time and the result is compared against 1 hour (=1/24 - see the page on Excel Dates & Times for an explanation of this). If the current time is less than 1 hour from the appointment time, the alert is shown; otherwise no text is shown in cell B2. The contents of cell B2 have also been formatted to have red bold text, to make the alert stand out more. Note that the above alert formula could be made more sophisticated by adding more conditions to the IF function to highlight when the appointment time has been passed, etc. Note also, that the above appointment alert will only work if your spreadsheet is being continually updated. While the spreadsheet is unused, the contents of cell B2 will stay the same as at the last evaluation.

The Excel TODAY function returns the current date. The function has no arguments and therefore, the format of the function is simply: TODAY()

Example
The following spreadsheets show 2 simple examples of calls to the function, 'TODAY', which were made on 16th November 2008. The first example shows the function used alone, and the second example shows the function used as a part of a formula that calculates the number of days that have passed since 31/12/2007. The spreadsheet on the left shows the format of the formulas and the spreadsheet on the right shows the results.

Formulas

Results on 16-Nov-08

Basic Description

Related Functions :
LOOKUP Function VLOOKUP Function

The Excel HLOOKUP function 'looks up' a given value in the top row of a data array (or table), and returns the corresponding value from another row of the array. The format of the function is:

HLOOKUP( lookup_value, table_array, row_index_num, [range_lookup] )

where the arguments are as follows: lookup_value The value that you want to look for, in the first row of the supplied data array The data array or table, that you want to search the first row of, for the supplied lookup_value The row number, within the supplied array, that you want the corresponding value to be returned from An optional logical argument, which can be set to TRUE or FALSE, meaning : TRUE - if the function cannot find an exact match to the supplied lookup_value, it should use the closest match below the supplied value (Note: If range_lookup is set to TRUE, the top row of the table_array must be in ascending order) FALSE - if the function cannot find an exact match to the supplied lookup_value, it should return an error

table_array

row_index_num

[range_lookup]

Examples
Hlookup Example 1 Cells A2-F6 of the spreadsheet below, show the exam scores for 5 students in 4 different subjects. If you want to look up a specific score (eg. Biology) for one of the students (eg. Ed), this can be done using the Hlookup function, as shown in cell B10 of the spreadsheet. In the example below, the formula is shown in cell B10 of the spreadsheet on the left, and the result is shown in the spreadsheet on the right.

Formulas:

Results:

In the above example, the Hlookup function searches through the top row of the table_array (the range A2A6), to find a match for the lookup_value (the name "Ed", in cell A10). When the the name 'Ed' is found, the function returns the corresponding value from the 5th row of the lookup_table.

This is illustrated on the right. The function finds the name 'Ed' in the top row of the table_array and then returns the value from the 5th row of the table_array. If we change the name in the individual spreadsheet from 'Ed' to 'Cara', the Hlookup functions would automatically recalculate the functions to display the exam results for Cara.

Hlookup Example 2 Cells A1-F3 of the spreadsheet below, show body types relating to body mass index (BMI), for the ranges 0 - 18.4, 18.5 - 24.9, 25.0 - 29.9 and over 30. Cell C6 shows the user's current BMI, which is 23.5, and cell C7 shows the Hlookup function that is used to look up the body type that relates to this BMI.

The Hlookup function in the above spreadsheet returns the result "Normal Weight", which is the correct body type for a BMI of 23.5. Note that, in this example, the range_lookup argument is set to TRUE, to tell that function that, if it cannot find an exact match to the supplied lookup_value, it should use the closest match below this value. Therefore, for all BMIs up to and including 18.4 the function would return "Underweight", for all BMIs between 18.5 and 24.9, the function would return "Normal Weight", etc.

Further Hlookup Examples For a practical example of the HLOOKUP function being used to create a variable drop-down list, see the Variable Drop-Down List page. Also, there are further examples on the Microsoft Office website.

Basic Description

Related Functions :
HLOOKUP Function LOOKUP Function

The Excel VLOOKUP function 'looks up' a given value in the left-hand column of a data array (or table), and returns the corresponding value from another column of the array. The format of the function is:

VLOOKUP( lookup_value, table_array, col_index_num, [range_lookup] )

where the arguments are as follows: lookup_value The value that you want to look for, in the left-hand column of the supplied data array The data array or table, that you want to search the left hand column of, for the supplied lookup_value The column number, within the supplied array, that you want the corresponding value to be returned from An optional logical argument, which can be set to TRUE or FALSE, meaning : TRUE - if the function cannot find an exact match to the supplied lookup_value, it should use the closest match below the supplied value (Note: If range_lookup is set to TRUE, the left-hand

table_array

col_index_num

[range_lookup]

column of the table_array must be in ascending order) FALSE - if the function cannot find an exact match to the supplied lookup_value, it should return an error

Examples
Vlookup Example 1 In the spreadsheet below, columns A and B list an inventory of grocery items, and their prices, and cell E2 of the spreadsheet shows a simple example of the Vlookup function being used to look up the price of an item from the inventory.

The above Vlookup function returns the price for "Cornflakes", which is $3.50. In this example: the lookup_value is the text string "Cornflakes", which is located in cell D2 the table_array is columns A-B of the spreadsheet the col_index_num is set to 2, to denote that the value returned should be taken from column 2 of the table_array the range_lookup argument is set to FALSE, to indicate that we only want a result to be returned if an exact match to the lookup_value is found

Vlookup Example 2 In the spreadsheet below, columns A-C list the grades that are assigned to examination marks lying within the ranges 0-44%, 45%-54%, etc. Cell F2 shows the score of 52% that was achieved by the student "Anne" in an examination. The Vlookup function in cell G2 looks up this score in column A of the spreadsheet and returns the associated grade from column C. Note that, in this example, if the exact score of 52% is not found in column A, we want, instead, to use the nearest value below this score.

The above Vlookup function returns the grade for the score 52%, which is E. In this example: the lookup_value is the value 52%, which is located in cell F2 the table_array is the range A2-C7 of the spreadsheet the col_index_num is set to 3, to denote that the value returned should be taken from column 3 of the table_array the range_lookup argument is set to TRUE, to indicate that, if an exact match to the lookup_value is not found, we want to use the closest value below the lookup_value

Further Vlookup Examples For a practical example of the VLOOKUP function being used to create a variable chart, see the Excel Variable Chart page. Also, there is an excellent video tutorial on the Excel Vlookup function on the Brainstorm Inc. website, and several further examples on the Microsoft Office website.

Basic Description
The Excel LOOKUP function 'looks up' a supplied value within a data set and returns the corresponding value from a second data set. If the function fails to find an exact match to the supplied 'lookup' value, it uses the largest value that is less than or equal to the supplied 'lookup' value. Because the function finds a 'nearest' match, it is not suitable for all lookups - if you require an exact match to your 'lookup' value, or an error message if this isn't found, consider using the Vlookup or the Hlookup Function. For the Lookup function to work correctly, it is necessary that the data to be searched be ordered (ascending numerically or alphabetically). If the data is not ordered, the function may return unpredictable results. The Excel Lookup function has two forms - the Vector form and the Array form. These are described individually below.

The Vector Form of the Excel Lookup Function


The vector form of the Lookup function 'looks up' a value in a data vector (ie. a 1-dimensional list of data) and returns the corresponding value from a second data vector.

The format of the function is :

LOOKUP( lookup_value, lookup_vector, result_vector )

Where the arguments are as follows : lookup_value lookup_vector result_vector the value that you want to look up in the supplied lookup_vector A 1-dimensional list of data, which we want to search for the lookup_value A 1-dimensional list of data, from which we want to return a value (must be the same length as the lookup_vector)

Example of the Vector Form of the Lookup Function


In the spreadsheet below, cells A1-E3 relate to a variable interest rate, that is paid on a bank account. For balances of 0-$999.99, the interest rate is 3%, for balances of $1000-$1,999.99, the interest rate is 4%, etc. Cell A6 of the spreadsheet shows the balance of a specific bank account and cell B6 shows the vector form of the Excel Lookup function being used to look up the interest rate relating to this balance.

The above Lookup function returns the interest rate of 5%, which is the correct interest rate to apply to a bank account with a balance of $45,000. In this example: the lookup_value is the value $45,000.00, which is located in cell A6 the lookup_array is the vector of data in cells B1-E1 of the spreadsheet the result_array is the vector of data in cells B3-E3 of the spreadsheet

Note that the vector form of the Excel Lookup function can be used with any two sets of data that have oneon-one matching values. For example, two columns of data, two rows of data, or even a column and a row would work, as long as the lookup_vector was ordered (alphabetically or numerically), and the two data sets were the same length.

The Array Form of the Excel Lookup Function


The array form of the Lookup function 'looks up' a supplied value in the first column or row of a supplied data array (ie. a 2-dimensional table of data) and returns the corresponding value from the last column or row of the array. The format of the function is :

LOOKUP( lookup_value, array )

Where the arguments are as follows : lookup_value array the value that you want to look up in the supplied data array A 2-dimensional array (or table) of data which we want to search the first column or row of, for the lookup_value, and which contains the values to be returned in the last column or row

Example of the Array Form of the Lookup Function


In the spreadsheet below, columns A-C list the grades that are assigned to examination marks lying within the ranges 0-44%, 45%-54%, etc. Cell F2 shows the score of 82% that was achieved by the student "Chris" in an examination. The Lookup function in cell G2 looks up this score in column A of the spreadsheet and returns the associated grade from column C. Note that, in this example, if the exact score of 82% is not found in column A, we want, instead, to use the nearest value below this score.

The above Lookup function returns the grade for the score 82%, which is B. In this example: the lookup_value is the value 82%, which is located in cell F2 the array is the vector of data in cells A2-C7 of the spreadsheet

Note: In this example, the Excel Lookup function recognised that it was searching for the lookup_value in the first column of the supplied array, and returning a value from the last column. However if the array is

transposed so that the data runs across 3 rows, the function will recognise this, and will still return the correct values.

Further Lookup Function Examples


Further examples of the Excel Lookup function can be found on the Microsoft Office website.

Basic Description
The Excel SUM function returns the sum of one or more numerical values.

The numerical values can be supplied to the function as one or more of the following: individual numbers individual cells containing numbers ranges of cells containing numbers

These argument types can be mixed within a single call to the function, if required. The format of the SUM function is therefore:

SUM( number1 or cell1 or range1, [number2 or cell2 or range2], ... )

Examples
The following example shows the function used to SUM the same set of numerical values in 4 different ways. A B C D E F G H

1 Score1 Score2 Score3 Score4 Score5 Total Score 2 3 4 5 8 8 8 8 7 7 7 7 9 9 9 9 6 6 6 6 10 =SUM(8, 7, 9, 6, 10) 10 =SUM(A3, B3, C3, D3, E3) 10 =SUM(A4:E4) 10 =SUM(8, B5, C5:E5)

The result of each of the above SUM functions is 40, as they all calculate the SUM of the same 5 numbers:

1 Score1 Score2 Score3 Score4 Score5 Total Score 2 3 4 5 8 8 8 8 7 7 7 7 9 9 9 9 6 6 6 6 10 10 10 10 40 40 40 40

The Excel SUBTOTAL function performs a specified calculation (eg. the sum, product, average, etc.) for a supplied set of values. The format of the function is :

SUBTOTAL( Function_num, Ref1, [Ref2], ... )

Where the arguments are as follows : Function_num A number that denotes the calculation type (eg. sum, product, average, etc.) One or more references to cells containing the values that the calculation is to be performed on.

Ref1, [Ref2], ...

Function_num Function_num (include hidden values) (ignore hidden values) 1 2 3 4 5 6 7 8 9 101 102 103 104 105 106 107 108 109

Function AVERAGE COUNT COUNTA MAX MIN PRODUCT STDEV STDEVP SUM

10 11

110 111

VAR VARP

The possible values for the Function_num argument are shown in the table on the right. You will notice that you can choose to ignore or to include hidden values. This applied only to rows that have been hidden using the 'Hide' command in the row or column formatting options. Note that the option to include hidden cells does not apply to cells that have been filtered out using the Excel Autofilter. Filtered out cells are not included in any Subtotal calculations. This is illustrated in the examples below.

Examples
The following examples all use a simple spreadsheet that shows monthly sales figures, between January and March, for 3 teams. In each of the examples, the spreadsheet on the left shows the format of the Subtotal function, and the spreadsheet on the right shows the result.

Example 1 In this example, the Subtotal function is used to calculate the sum and the average monthly sales per team. All of the cells in the range of sales figures are visible, so all values are included in the subtotal calculations :
Formulas Result

Note that, in the example above, as all cells are visible, we could have set the Function_num argument to either 9 or 109 for the sum - both values would give the same result. Similarly, using either 1 or 101 for the average would give the same results.

Example 2 In this example, the teams have been filtered, using the Excel Autofilter, to show Team 1 only. In this case, the Subtotal function's calculations will be for the visible cells only (ie. for Team 1 only) :
Formulas Result

Note that, in the example above, because the rows for Teams 2 & 3 have been filtered out, using the Excel Autofilter, we could have used a Function_num argument of either 9 or 109 to give the same sum, (ie. the sum for the Team 1 sales only). Similarly, we could have used either 1 or 101 to give the same the average calculation.

Example 3 In this example, rows 3, 4, 6, 7, 9, and 10 of the spreadsheet have been hidden using row formatting. (ie. by highlighting these rows, right clicking with the mouse and selecting Hide). In the spreadsheet below, the Subtotal function is used to calculate the sum and the average monthly sales across ALL teams. Because we are using the values of 9 and 1 for the Function_num arguments, the hidden cells are included in the calculations :
Formulas Result

Note that, in the example above, we could exclude the hidden values from the calculations by using the Function_num values of 109 and 101 for the sum and average functions respectively.

Basic Description

Related Functions :
AVERAGEIF Function AVERAGEIFS Function SUMIFS Function

The Excel SUMIF function finds values in a supplied array, that satisfy a given criteria, and returns the sum of the corresponding values in a second supplied array. The format of the function is:

SUMIF(Range, Criteria, [Sum_Range])

Where the arguments are as follows: Range An array of values (or range of cells containing values) to be tested against the supplied Criteria A user-defined condition to test against each of the values in Range An optional array of numeric values (or cells containing numbers) which are to be added together, if the corresponding Range entry satisfies the supplied Criteria If the Sum_Range argument is omitted, the values from the Range argument are summed
(Note that if supplied, the Sum_Range array must have the same length as the supplied Range array)

Criteria [Sum_Range]

Wildcards You can also use the following wildcards in text-related criteria: ? * matches any sequence of characters matches any single character

if you do actually want to find the ? or * character, type the ~ symbol before this character in your search. eg. the condition "A*e" will match all cells containing a text string beginning with "A" and ending in "e".

The Criteria can be either: - a numeric value (which may be an integer, decimal, date, time, or logical value) (eg. 10, 01/01/2008, TRUE) or - a text string (eg. "Text", "Friday") or - an expression (eg. ">12", "<>0")

and can be supplied to the function either directly, as a reference to a cell, or as a value returned from another function or formula.

Note that if your Criteria is a text string or an expression, this must be supplied to the function in quotes. Also note that the Excel Sumif function is not case-sensitive. So, for example, the text strings "TEXT" and "text" will be considered to be equal.

Example 1
The following example shows the Excel Sumif function using critia based on text strings, numerical values or logical values. The spreadsheet on the left shows the format of the functions and the spreadsheet on the right shows the results from the function calls. Formulas A 1 Monday 2 Tuesday 3 Thursday 4 Friday 5 Thursday 6 7 8 9 10 11 12 13 14 15 16 =SUMIF( A$1:A$14, "Thursday", B$1:B$14 ) 17 =SUMIF( A$1:A$14, 5, B$1:B$14 ) 18 =SUMIF( A$1:A$14, ">2", B$1:B$14 ) 19 =SUMIF( A$1:A$14, TRUE, B$1:B$14 ) 20 =SUMIF( A$1:A$14, "<>TRUE", B$1:B$14 ) 5 2 3 4 5 1 0 1 1 B 500 50 100 100 200 300 200 100 50 100 100 200 250 50 C Results A 1 Monday 2 Tuesday 3 Thursday 4 Friday 5 Thursday 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 300 400 550 400 1900 5 2 3 4 5 1 0 1 1 B 500 50 100 100 200 300 200 100 50 100 100 200 250 50

In the above example, each call to the Excel Sumif function checks the contents of cells A1 - A14. For each of these cells that satisfy the supplied criteria, the corresponding cells in the range B1 - B14 are added together. In cell A16, for example, the cells A3 and A5 are both equal to the text string "Thursday". Therefore, the corresponding values from cells B3 and B5 (100 and 200) are added together, resulting in the sum of 300.

Example 2
The following example shows the Excel Sumif function used to total sales figures for the salesperson named in cell F1. This is done by setting the supplied Criteria to be a reference to cell F1. In the spreadsheet below, the name "John" is typed into cell F1 and so the Sumif function (shown in cell E2) sums all the sales figures that relate to 'John', giving a total of $19,000. If the name in cell F1 is changed to "Peter", "Mary" or "Joanne", the function in cell E2 will total the sales figures for these names accordingly.

A 1 Name 2 John 3 Peter 4 Mary 5 Joanne 6 John 7 Peter 8 Mary 9 Joanne 10 John 11 Peter 12 Mary 13 Joanne 14 John 15 Peter

B Month May May May May June June June June July July July July August August

C Sales $6,000

E Total Sales figures for : John

=SUMIF( A:A, F1, C:C ) $4,000 $7,000 $2,000 $3,000 $1,000 $1,500 $5,000 $7,000 $5,000 $6,000 $6,000 $3,000 $4,000

16 Mary 17 Joanne

August August

$5,000 $4,000

To make your spreadsheet more user-friendly, you could use Excel data validation to control the contents of cell F1 in the above example. This would enable users of the spreadsheet to select the cell value from a drop-down list of names and would also prevent users from inserting unexpected data into this cell.

Further examples of the Excel Sumif function can be found on the Microsoft Office website.

Basic Description

Related Functions :
MAXA Function MIN Function MINA Function LARGE Function SMALL Function

The Excel MAX function returns the largest value from a supplied set of numerical values. The format of the function is:

MAX( Number1, [Number2], ... )

where the Number arguments are a set of one or more numeric values, or arrays of numeric values, that you want to return the largest value from - these values can be supplied directly to the function, or as one or more cells or ranges of cells containing numeric values. Note that in Excel 2007, you can provide up to 255 Number arguments to the function, but in Excel 2003, you can only provide up to 30 Number arguments.

Example
The following example shows the Max function used to retrieve the largest value from the set of values in cells A1 - A5. The format of the function is shown in the spreadsheet on the left and the resulting value is shown in the spreadsheet on the right. Formula Result

Basic Description

Related Functions :
MINA Function MAX Function MAXA Function LARGE Function SMALL Function

The Excel MIN function returns the smallest value from a supplied set of numerical values. The format of the function is:

MIN( Number1, [Number2], ... )

where the Number arguments are a set of one or more numeric values, or arrays of numeric values, that you want to return the smallest value from - these values can be supplied directly to the function, or as one or more cells or ranges of cells containing numeric values. Note that in Excel 2007, you can provide up to 255 Number arguments to the function, but in Excel 2003, you can only provide up to 30 Number arguments.

Example
The following example shows the Min function used to retrieve the smallest value from the set of values in cells A1 - A5. The format of the function is shown in the spreadsheet on the left and the resulting value is shown in the spreadsheet on the right. Formula Result

The Excel AVERAGE function returns the arithmetic mean of a list of supplied numbers. The format of the function is:

AVERAGE( number1, [number2], ... )

where the number arguments are a set of one or more numeric values, or arrays of numeric values, for which you want to calculate the average - these values can be supplied directly to the function, or as one or more cells or ranges of cells containing numeric values. In Excel 2007 & Excel 2010, you can provide up to 255 number arguments to the Average function, but in Excel 2003, the function can only accept up to 30 arguments. The Excel Average Function is very similar to the Excel Averagea Function. The only difference between these two functions is the way in which logical values, or text values within arrays or references are treated in the calculation of the arithmetic mean. This is shown in the table below: AVERAGE Function Logical values or text representations of numbers, typed directly into the list of arguments Text that cannot be interpreted as a number, typed directly into the list of arguments Logical values, within reference arguments arrays or ARE counted (TRUE=1, FALSE=0) AVERAGEA Function ARE counted (TRUE=1, FALSE=0)

#VALUE! error

#VALUE! error

Ignored

ARE counted (TRUE=1, FALSE=0)

Text (including empty text "", text representations of numbers, or other text), within arrays or reference arguments Empty cells

Ignored

Counted as zero

Ignored

Ignored

Examples

The following spreadsheet shows the Excel Average function used to calculate the arithmetic mean of the set of values in cells A1-A5. Although the same 5 values are provided to each of the functions in cells B1B4, in each case, the values are provided to the function in different ways. The format of the functions are shown in the spreadsheet on the left and the resulting values are shown in the spreadsheet on the right.
Formulas: Results:

Further examples of the Excel Average function can be found on the Microsoft Office website.

You might also like