How to find values in a list of text fields

  • Thread starter Thread starter deniseandgavin
  • Start date Start date
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.
 
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:
 
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?
 
If I just change the formula to

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

it will handle different length text strings.
Excellent!
 
Back
Top