Comp102 BT Week 9 Excel2 Eng
Comp102 BT Week 9 Excel2 Eng
For example, =IF(C2=”Yes”,1,2) says IF(C2 = Yes, then return a 1, otherwise return
a 2).
AND
Use the AND function, one of the logical functions, to determine if all conditions in
a test are TRUE.
=IF(AND(B5>750,C5>750),"Approve","Deny")
Use the OR function, one of the logical functions, to determine if any conditions in
a test are TRUE.
NOT
Use the NOT function, one of the logical functions, when you want to make sure
one value is not equal to another.
Lookup and Reference Functions
• VLOOKUP: Searches for a value in the first column of a table and returns a
value in the same row from another column.
• HLOOKUP: Searches for a value in the top row of a table and returns a value in
the same column from a specified row.
=VLOOKUP(What you want to look up, where you want to look for it, the column
number in the range containing the value to return, return an Approximate or Exact
match – indicated as 1/TRUE, or 0/FALSE).
HLOOKUP
Searches for a value in the top row of a table or an array of values, and then
returns a value in the same column from a row you specify in the table or array.
Use HLOOKUP when your comparison values are located in a row across the top of
a table of data, and you want to look down a specified number of rows. Use
VLOOKUP when your comparison values are located in a column to the left of the
data you want to find. The H in HLOOKUP stands for "Horizontal."
INDEX/MATCH
The INDEX function returns a value or the reference to a value from within a table or range.
INDEX(array, row_num, [column_num])
The MATCH function searches for a specified item in a range of cells, and then returns the
relative position of that item in the range. For example, if the range A1:A3 contains the values 5,
25, and 38, then the formula =MATCH(25,A1:A3,0) returns the number 2, because 25 is the
second item in the range.
Date and Time Functions
TODAY: Returns the current date.
NOW: Returns the current date and time.
DATE: Creates a date from individual year, month, and day components.
TODAY
The TODAY function returns the serial number of the current date. The serial
number is the date-time code used by Excel for date and time calculations. If the
cell format was General before the function was entered, Excel changes the cell
format to Date. If you want to view the serial number, you must change the cell
format to General or Number.
The TODAY function is useful when you need to have the current date displayed on
a worksheet, regardless of when you open the workbook. It is also useful for
calculating intervals. For example, if you know that someone was born in 1963,
you might use the following formula to find that person's age as of this year's
birthday:
= YEAR( TODAY())-1963
NOW
Returns the serial number of the current date and time. If the cell format was
General before the function was entered, Excel changes the cell format so that it
matches the date and time format of your regional settings. You can change the
date and time format for the cell by using the commands in the Number group of
the Home tab on the Ribbon.
The NOW function is useful when you need to display the current date and time
on a worksheet or calculate a value based on the current date and time, and have
that value updated each time you open the worksheet.
DATE
Use Excel's DATE function when you need to take three separate values and
combine them to form a date.
Error Handling Functions
IFERROR: Returns a value you specify if a formula evaluates to an error; otherwise,
it returns the result of the formula.
ISERROR: Checks whether a value is an error and returns TRUE or FALSE.
IFERROR
You can use the IFERROR function to trap and handle errors in a formula. IFERROR
returns a value you specify if a formula evaluates to an error; otherwise, it returns
the result of the formula.
IFERROR(value, value_if_error)
ISERROR
The Excel ISERROR function returns TRUE for any error type excel generates,
including #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL! You can use
ISERROR together with the IF function to test for errors and display a custom
message, or run a different calculation when an error occurs.