You can use Excel features to −
You can also combine those features to get the specified results based on the inputs you have.
The syntax of the VLOOKUP function is
Where
Note − the first column containing the lookup_value can either be sorted in ascending order or not. but, the result can be based at the order of this column.
Note − If range lookup is omitted or true or 1, VLOOKUP works correctly only while the first column in table_array is sorted in ascending order. otherwise, it may result in wrong values. In such a case, use false for range lookup.
Consider a list of student marks. you can obtain the corresponding grades with VLOOKUP from an array containing the marks intervals and pass category.
Table array –
Note that the first column marks based on which the grades are received is sorted in ascending order. Therefore, using true for range_lookup argument you can get approximate match that is what is needed.
Name this array as Grades.
It is a good practice to name arrays on this way so that you need not consider the cell levels. Now, you are ready to look up the grade for the list of marks you have as follows –
As you can observe,
Marks |
Pass Category |
< 35 |
Fail |
>= 35 and < 50 |
Third Class |
>= 50 and < 60 |
Second Class |
>=60 and < 75 |
First Class |
>= 75 |
First Class with Distinction |
You will get the following results –
Consider a list of products containing the Product identity and price for every of the products. The product identity and price will be added to the end of the list whenever a new product is released. this would mean that the product IDs need not be in ascending order. The product list might be as shown below −
Table array –
Name this array as Product Info.
You can obtain the price of a product given the product id with the VLOOKUP feature as the product id is in the first column. The price is in column 3 and hence col_index_ num have to be 3.
The correct answer is from the Product Info array is 171.65. You can check the results.
You observe that you got −
This is because, the first column inside the Product Info array is not sorted in ascending order. hence, remember to use false whenever the data is not sorted.
You can use HLOOKUP function if the data is in rows rather than columns.
Let us take the example of product data. Suppose the array looks as follows –
The Syntax of HLOOKUP function is
Where
Note − If range_lookup is not noted or true or 1, HLOOKUP works successfully only when the first column in table_array is sorted in ascending order. otherwise, it may result in incorrect values. In such a case, use false for range_lookup.
You could obtain the price of a product given the product id with the HLOOKUP function as the product id is in the first row. The price is in row 3 and hence row_index_ num need to be 3.
The correct answer from the ProductRange array is 171.65. You can check the results.
You look at that as in the case of VLOOKUP, you got
This is because the first row in the ProductRange array is not sorted in ascending order. hence, remember to use false whenever the data is not sorted.
Consider the example of student marks used in VLOOKUP. Suppose you have the data in rows instead of columns as shown in the table given below –
table array –
Name this array as Grades Range.
Note that the first row marks based on which the grades are received is sorted in ascending order. hence, using HLOOKUP with true for range_lookup argument, you can get the Grades with approximate match and that is what is required.
As you can observe,
You can get the return value for approximate matches also. i.e. HLOOKUP computes as follows –
Marks |
< 35 |
>= 35 and < 50 |
>= 50 and < 60 |
>=60 and < 75 |
>= 75 |
Pass Category |
Fail |
Third Class |
Second Class |
First Class |
First Class with Distinction |
You will get the following results –
When you have an array of data, you can retrieve a value in the array by specifying the row number and column number of that value in the array.
Consider the following sales information, wherein you find the sales in each of the North, South, East and West regions by the salespersons who are listed.
Using INDEX Function, you can find −
You will get the following results –
Suppose you do no longer know the row numbers for the salespersons and column numbers for the regions. Then, you need to locate the row number and column number first before you retrieve the value with the index function.
You can do it with the match function as explained within the next section.
If you want the position of an item in a selection, you can use the match function. you can combine match and INDEX functions as follows –
You will get the following results –
|
|
Excel Data Analysis Related Tutorials |
|
---|---|
VBA For Excel Tutorial | Microsoft Excel Tutorial |
Microsoft Word Tutorial | Microsoft Powerpoint Tutorial |
Microsoft Entity Framework Tutorial | Microsoft Azure Tutorial |
Microsoft Project Tutorial | Advanced Excel Charts Tutorial |
Advanced Excel Functions Tutorial | Excel Dashboards Tutorial |
Excel pivot tables Tutorial | Excel Power View Tutorial |
Excel Data Analysis Related Interview Questions |
|
---|---|
VBA For Excel Interview Questions | Microsoft Excel Interview Questions |
Microsoft Word Interview Questions | Microsoft Powerpoint Interview Questions |
Microsoft Entity Framework Interview Questions | Microsoft Azure Interview Questions |
Microsoft Project Interview Questions | Excel Data Analysis Interview Questions |
Excel pivot tables Interview Questions | Excel Power View Interview Questions |
Microsoft Interview Questions |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.