ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   lookup a text cell and return text (https://www.excelbanter.com/excel-discussion-misc-queries/102479-lookup-text-cell-return-text.html)

Cristi R

lookup a text cell and return text
 
Hi Guys,

I need your help, and I hope I'll make myself clear. So, I have to
workshhets. In sheet A there is a database, and one of the columns consists
of different email addresses. In sheet B, there is another database, and one
of the columns is again containing email addresses. Some of them match with
the column from sheet A. Now on sheet 2, to each email address corresponds a
certain PIN number. What I want to do is: search if each of the email
addresses from Sheet A is found on sheet B, and if it is, then I want to
return in a cell the PIN number corresponding to it.

sheet A sheet B

434
545
655
434

So, in the above example, I need to see if
appears in the column
from sheet B, and then to return the # 434 in a cell next to the entry from
sheet A.

I hope I made myself clear enough. Help please!


tim m

lookup a text cell and return text
 
=VLOOKUP(A1,Sheet2!A1:B4,2,FALSE)

See if this is what you are after. (this looks at the cell contents of A1
which is your , it then looks in sheet 2 for the range of data you
want to search, then returns the 2nd column in that range (the 434). The
FALSE part means it is looking for an exact match.

"Cristi R" wrote:

Hi Guys,

I need your help, and I hope I'll make myself clear. So, I have to
workshhets. In sheet A there is a database, and one of the columns consists
of different email addresses. In sheet B, there is another database, and one
of the columns is again containing email addresses. Some of them match with
the column from sheet A. Now on sheet 2, to each email address corresponds a
certain PIN number. What I want to do is: search if each of the email
addresses from Sheet A is found on sheet B, and if it is, then I want to
return in a cell the PIN number corresponding to it.

sheet A sheet B

434
545
655
434

So, in the above example, I need to see if
appears in the column
from sheet B, and then to return the # 434 in a cell next to the entry from
sheet A.

I hope I made myself clear enough. Help please!


Toppers

lookup a text cell and return text
 
To handle "Not found" condition (and return empty cell):

=IF(ISNA(VLOOKUP(A1,Sheet2!A1:B4,2,FALSE)),"",
VLOOKUP(A1,Sheet2!A1:B4,2,FALSE))


"tim m" wrote:

=VLOOKUP(A1,Sheet2!A1:B4,2,FALSE)

See if this is what you are after. (this looks at the cell contents of A1
which is your , it then looks in sheet 2 for the range of data you
want to search, then returns the 2nd column in that range (the 434). The
FALSE part means it is looking for an exact match.

"Cristi R" wrote:

Hi Guys,

I need your help, and I hope I'll make myself clear. So, I have to
workshhets. In sheet A there is a database, and one of the columns consists
of different email addresses. In sheet B, there is another database, and one
of the columns is again containing email addresses. Some of them match with
the column from sheet A. Now on sheet 2, to each email address corresponds a
certain PIN number. What I want to do is: search if each of the email
addresses from Sheet A is found on sheet B, and if it is, then I want to
return in a cell the PIN number corresponding to it.

sheet A sheet B

434
545
655
434

So, in the above example, I need to see if
appears in the column
from sheet B, and then to return the # 434 in a cell next to the entry from
sheet A.

I hope I made myself clear enough. Help please!


kraljb

lookup a text cell and return text
 

INDEX and MATCH works

INDEX(<Insert Range of PIN Numbers from Sheet B,MATCH(<insert Email
Address from Sheet A,<insert Range of Email Addresses from Sheet
B,0),0)

Make sure that the ranges selected for PIN Numbers and Email Addresses
are equivalent (i.e. rows 1-100 for both, not rows 1-50 for one and
1-400 for the other), else you can end up with errors.


--
kraljb
------------------------------------------------------------------------
kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955
View this thread: http://www.excelforum.com/showthread...hreadid=567116


Cristi R

lookup a text cell and return text
 
Thank you all, this was very useful!

Kind regards,
Cristi

"Toppers" wrote:

To handle "Not found" condition (and return empty cell):

=IF(ISNA(VLOOKUP(A1,Sheet2!A1:B4,2,FALSE)),"",
VLOOKUP(A1,Sheet2!A1:B4,2,FALSE))


"tim m" wrote:

=VLOOKUP(A1,Sheet2!A1:B4,2,FALSE)

See if this is what you are after. (this looks at the cell contents of A1
which is your , it then looks in sheet 2 for the range of data you
want to search, then returns the 2nd column in that range (the 434). The
FALSE part means it is looking for an exact match.

"Cristi R" wrote:

Hi Guys,

I need your help, and I hope I'll make myself clear. So, I have to
workshhets. In sheet A there is a database, and one of the columns consists
of different email addresses. In sheet B, there is another database, and one
of the columns is again containing email addresses. Some of them match with
the column from sheet A. Now on sheet 2, to each email address corresponds a
certain PIN number. What I want to do is: search if each of the email
addresses from Sheet A is found on sheet B, and if it is, then I want to
return in a cell the PIN number corresponding to it.

sheet A sheet B

434
545
655
434

So, in the above example, I need to see if
appears in the column
from sheet B, and then to return the # 434 in a cell next to the entry from
sheet A.

I hope I made myself clear enough. Help please!



All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com