If cell value match the value in one of the cell in row range, then display value of the reference cell

frigens

New Member
Joined
Jan 24, 2014
Messages
3
This is what I'm working on, I have following example data on sheet 2

A
B
C
1
100
AAA
2
101
BBB
3
102
CCC
4
103
DDD

<tbody>
</tbody>

And on sheet 1,

A
B
C
1
100
2
103
3
102
4

<tbody>
</tbody>

I'm wondering if there is a formula I can put on cell B1-B4 on sheet 1 that make excel check the value of the relative A cell and if the value match with one of the cell in A column sheet 2, then display value of the relative B cell on sheet 2?

ie. If I input "101" value in A4 cell on sheet 1, excel should return "BBB" result.

Any advice is appreciated.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
My apology, I might have used a bad example. I'm actually working with different column than A and B. and I think VLOOKUP command only check the data on the leftmost column.

I have datas in column D of sheet 1 that I want it to be checked against data in column C of sheet 2. If matched, then column E of the sheet 1 should display the value of relative cell in column F of sheet 2.
 
Upvote 0
Try this...

=IFERROR(VLOOKUP(D4,Sheet2!C:F,4,0),"")


VLOOKUP looks in the fist column of the Table_array (C:F in this case). It returns the row match from the specified Col_index_num. (4; Column F is the 4th column of C:F)

Syntax

VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)

Lookup_value The value to search in the first column of the table array. Lookup_value can be a value or a reference. If lookup_value is smaller than the smallest value in the first column of table_array, VLOOKUP returns the #N/A error value.
Table_array Two or more columns of data. Use a reference to a range or a range name. The values in the first column of table_array are the values searched by lookup_value. These values can be text, numbers, or logical values. Uppercase and lowercase text are equivalent.

Col_index_num The column number in table_array from which the matching value must be returned. A col_index_num of 1 returns the value in the first column in table_array; a col_index_num of 2 returns the value in the second column in table_array, and so on. If col_index_num is:


  • Less than 1, VLOOKUP returns the #VALUE! error value.
  • Greater than the number of columns in table_array, VLOOKUP returns the #REF! error value.
Range_lookup A logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match:

  • If TRUE or omitted, an exact or approximate match is returned. If an exact match is not found, the next largest value that is less than lookup_value is returned.
The values in the first column of table_array must be placed in ascending sort order; otherwise, VLOOKUP may not give the correct value. You can put the values in ascending order by choosing the Sort command from the Data menu and selecting Ascending. For more information, see Default sort orders.

  • If FALSE, VLOOKUP will only find an exact match. In this case, the values in the first column of table_array do not need to be sorted. If there are two or more values in the first column of table_array that match the lookup_value, the first value found is used. If an exact match is not found, the error value #N/A is returned.
Remarks


  • When searching text values in the first column of table_array, ensure that the data in the first column of table_array does not have leading spaces, trailing spaces, inconsistent use of straight ( ' or " ) and curly ( ‘ or “) quotation marks, or nonprinting characters. In these cases, VLOOKUP may give an incorrect or unexpected value. For more information on functions that you can use to clean text data, see Text and Data functions.
  • When searching number or date values, ensure that the data in the first column of table_array is not stored as text values. In this case, VLOOKUP may give an incorrect or unexpected value. For more information, see Convert numbers stored as text to numbers.
  • If range_lookup is FALSE and lookup_value is text, then you can use the wildcard characters, question mark (?) and asterisk (*), in lookup_value. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) preceding the character.
 
Upvote 0

Forum statistics

Threads
1,202,962
Messages
6,052,821
Members
444,602
Latest member
Cookaa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top