Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

Excel Unit 3

Index and Match Function


Data Validation
Dr. Mamta Santosh Nair
Index Fucntion
• The INDEX function returns a value or the reference to a value from within a table or range.
• Returns the reference of the cell at the intersection of a particular row and column. If the reference is made up of non-
adjacent selections, you can pick the selection to look in.
• Syntax
• INDEX(reference, row_num, [column_num], [area_num])
• The reference form of the INDEX function has the following arguments:
• reference    Required. A reference to one or more cell ranges.
• If you are entering a non-adjacent range for the reference, enclose reference in parentheses.
• If each area in reference contains only one row or column, the row_num or column_num argument, respectively, is optional. For example,
for a single row reference, use INDEX(reference,,column_num).
• row_num    Required. The number of the row in reference from which to return a reference.
• column_num    Optional. The number of the column in reference from which to return a reference.
• area_num    Optional. Selects a range in reference from which to return the intersection of row_num and column_num.
The first area selected or entered is numbered 1, the second is 2, and so on. If area_num is omitted, INDEX uses area 1. 
The areas listed here must all be located on one sheet.  If you specify areas that are not on the same sheet as each
other, it will cause a #VALUE! error.  If you need to use ranges that are located on different sheets from each other, it is
recommended that you use the array form of the INDEX function, and use another function to calculate the range that
makes up the array.  For example, you could use the CHOOSE function to calculate which range will be used.
Example
Data Data
Apples Lemons
Bananas Pears
Formula Description Result
=INDEX(A2:B3,2,2) Value at the intersection of the Pears
second row and second column
in the range A2:B3.
=INDEX(A2:B3,2,1) Value at the intersection of the Bananas
second row and first column in
the range A2:B3.
Match Function
• 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.

MATCH(lookup_value, lookup_array, [match_type])
• The MATCH function syntax has the following arguments:
• lookup_value    Required. The value that you want to match in lookup_array. For example, when you look up
someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone
number is the value you want.

The lookup_value argument can be a value (number, text, or logical value) or a cell reference to a number, text, or
logical value.

• lookup_array    Required. The range of cells being searched.


• match_type    Optional. The number -1, 0, or 1. The match_type argument specifies how Excel
matches lookup_value with values in lookup_array. The default value for this argument is 1.

The following table describes how the function finds values based on the setting of the match_type argument
Match_type Behavior
1 or omitted MATCH finds the largest value that is less than or equal
to lookup_value. The values in the lookup_array argument
must be placed in ascending order, for example: ...-2, -1, 0,
1, 2, ..., A-Z, FALSE, TRUE.

0 MATCH finds the first value that is exactly equal


to lookup_value. The values in the lookup_array argument
can be in any order.

-1 MATCH finds the smallest value that is greater than or


equal tolookup_value. The values in
the lookup_array argument must be placed in
descending order, for example: TRUE, FALSE, Z-A, ...2, 1,
0, -1, -2, ..., and so on.
Data Validation
• You can use data validation to restrict the type of data or the
values that users enter into a cell. One of the most common
data validation uses is to create a drop-down list.
•On the Settings tab, under Allow,
select an option:

1.Select the cell(s) you want to create a rule for. •Whole Number - to restrict the cell to
2.Select Data >Data Validation. accept only whole numbers.
                       
3.On the Settings tab, under Allow, select an •Decimal - to restrict the cell to accept
option: only decimal numbers.
•Whole Number - to restrict the cell to
accept only whole numbers. •List - to pick data from the drop-down
•Delect the cell(s) you want to create a list.
rule for.
•Date - to restrict the cell to accept only
•Select Data >Data Validation. date.

• Data Validation •Time - to restrict the cell to accept


only time.

•Text Length - to restrict the length of


the text.

•Custom – for custom formula.


1. Under Data, select a condition: 5. On the Settings tab, under Allow, select an
1. between option:
2. not between 6. Set the other required values, based on what
3. equal to you chose for Allow and Data. For example, if
4. not equal to you select between, then select
5. greater than the Minimum: and Maximum: values for the
6. less than cell(s).
7. greater than or equal to 7.Select the Ignore blank checkbox if you want
8. less than or equal to to ignore blank spaces.
2.On the Settings tab, under Allow,
select an option:
3.Set the other required values, based
on what you chose
for Allow and Data. For example, if
you select between, then select
the Minimum: and Maximum: values
for the cell(s).
4.Select the Ignore blank checkbox if
you want to ignore blank spaces.
If you want to add a Title and message for your rule,
select the Input Message tab, and then type a title and
input message.
1.Select the Show input message when cell is
selected checkbox to display the message when the user
selects or hovers over the selected cell(s).
2.Select OK.
3.Now, if the user tries to enter a value that is not valid, a
pop-up appears with the message, “This value doesn’t
match the data validation restrictions for this cell.”

You might also like