Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default Use 2nd digit from the left in cell contents for vlookup

Need to do a VLOOKUP and have it look for the 2nd digit from the left
in a cells contents, and find this value in a table,a and return a
result.

iow: If the cells contents are 2B75478A3, it would look for the "B" in
the table; other variations would have the formula look for the 3rd
character from the left or 7.

Table would be B2:G20, column would be 4




TIA for thoughts.

Pierre

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Use 2nd digit from the left in cell contents for vlookup

Assuming you know how to use Vlookup, you could use the MID function to
extract the specific character.

=MID(A1,2,1)

This instance of Mid exctracts a string from the second character of
cell A1 that is one character long.

I put your funky number in to cell A1 and the formula above into A2 and
voila! the answer is B.

Cheers,
Jason Lepack

Pierre wrote:
Need to do a VLOOKUP and have it look for the 2nd digit from the left
in a cells contents, and find this value in a table,a and return a
result.

iow: If the cells contents are 2B75478A3, it would look for the "B" in
the table; other variations would have the formula look for the 3rd
character from the left or 7.

Table would be B2:G20, column would be 4




TIA for thoughts.

Pierre


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default Use 2nd digit from the left in cell contents for vlookup


jlepack wrote:
Assuming you know how to use Vlookup, you could use the MID function to
extract the specific character.

=MID(A1,2,1)

This instance of Mid exctracts a string from the second character of
cell A1 that is one character long.

I put your funky number in to cell A1 and the formula above into A2 and
voila! the answer is B.

Cheers,
Jason Lepack



Voila! Works too well.
Thanks Jason

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Use 2nd digit from the left in cell contents for vlookup

Try something like this:

With
A1: (a source string, like 2B75478A3)

This formula looks up the 2nd char from that string in the table at B2:G20
and returns the corresponding value from Col_G

A2: =VLOOKUP(MID(A1,2,1),B2:G20,4,0)

OR...if you want error checking
A2: =IF(COUNTIF(B2:B20,MID(A1,2,1)),VLOOKUP(MID(A1,2,1 ),B2:G20,4,0),"NO
MATCH")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Pierre" wrote:

Need to do a VLOOKUP and have it look for the 2nd digit from the left
in a cells contents, and find this value in a table,a and return a
result.

iow: If the cells contents are 2B75478A3, it would look for the "B" in
the table; other variations would have the formula look for the 3rd
character from the left or 7.

Table would be B2:G20, column would be 4




TIA for thoughts.

Pierre


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default Use 2nd digit from the left in cell contents for vlookup


Ron Coderre wrote:
Try something like this:

With
A1: (a source string, like 2B75478A3)

This formula looks up the 2nd char from that string in the table at B2:G20
and returns the corresponding value from Col_G

A2: =VLOOKUP(MID(A1,2,1),B2:G20,4,0)

OR...if you want error checking
A2: =IF(COUNTIF(B2:B20,MID(A1,2,1)),VLOOKUP(MID(A1,2,1 ),B2:G20,4,0),"NO
MATCH")

Is that something you can work with?
***********
Regards,
Ron


Ron, that does the trick as well! Thanks much for the error checking
node too.

Pierre

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumproduct issues SteveDB1 Excel Worksheet Functions 25 June 3rd 09 04:58 PM
Formulas to copy contents of one cell in a worksheet to another ce Coachy Excel Discussion (Misc queries) 1 November 11th 06 02:13 AM
Selectively Clearing cell contents jdd Excel Worksheet Functions 2 April 22nd 06 04:06 AM
Returning Cell Value if someone deletes the contents of a cell mmc308 Excel Worksheet Functions 4 March 31st 06 06:41 PM
How do I clear the contents of one cell from another cell? RonB Excel Worksheet Functions 1 September 26th 05 07:33 PM


All times are GMT +1. The time now is 04:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"