How to find values in a list of text fields

D

deniseandgavin

On sheet A I have account codes entered as numeric fields. On sheet B
I have a list of account codes (formatted as text) and their
corresponding account name.

Looking up the account code in sheet A I want to find that account
code in sheet B and return the account name.

How can I use a numeric field in A to find items that are formatted as
text in sheet B?

Thanks for any help.
 
S

Stefi

If your account codes (formatted as text) are of fixed length (5 in my
example, "00000" represents five digits, change it to your needs!), ), try
this:
=VLOOKUP(TEXT(A2,"00000"),SheetB!A:B,2,FALSE)

Regards,
Stefi


„[email protected]†ezt írta:
 
D

deniseandgavin

If your account codes (formatted as text) are of fixed length (5 in my
example, "00000" represents five digits, change it to your needs!), ), try
this:
=VLOOKUP(TEXT(A2,"00000"),SheetB!A:B,2,FALSE)

Regards,
Stefi

[email protected]” ezt írta:







- Show quoted text -

Works great except...the fields vary in length. Is there any way to
make this element in the formula more dynamic?
 
D

deniseandgavin

If I just change the formula to

=VLOOKUP(TEXT(A2,"0"),SheetB!A:B,2,FALSE)

it will handle different length text strings.
Excellent!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top