Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
AB AB is offline
external usenet poster
 
Posts: 33
Default Lookup references

Why doesn't this formula work!?!

=LOOKUP(LEFT(A1,1),NUMS,LETS)

Column A contains numbers with multiple digits.
NUMS is a list of single digit numbers (Column A in Sheet 2)
LETS is a list of letters (Column B in Sheet 2)

I want to find the first digit of the number in A1, look it up in NUMS, and
return the corresponding value from LETS.

This works just fine as =LOOKUP(A1,NUMS,LETS) when A1 refers to a single
digit number from the NUMS list.
It also works just fine as =LOOKUP(1,NUMS,LETS) and returns the letter that
corresponds to the number 1.
It returns #N/A when my lookup value uses the left formula.

Help? Why doesn't this work? And is there another way to make this happen?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 89
Default Lookup references

The left function returns a text value so your comparison is trying to
compare text vs a number. So you don't get a match.

Stick a value function in the formula

=LOOKUP(VALUE(LEFT(A2,1)),Num,Let)

Mike

"Ab" wrote:

Why doesn't this formula work!?!

=LOOKUP(LEFT(A1,1),NUMS,LETS)

Column A contains numbers with multiple digits.
NUMS is a list of single digit numbers (Column A in Sheet 2)
LETS is a list of letters (Column B in Sheet 2)

I want to find the first digit of the number in A1, look it up in NUMS, and
return the corresponding value from LETS.

This works just fine as =LOOKUP(A1,NUMS,LETS) when A1 refers to a single
digit number from the NUMS list.
It also works just fine as =LOOKUP(1,NUMS,LETS) and returns the letter that
corresponds to the number 1.
It returns #N/A when my lookup value uses the left formula.

Help? Why doesn't this work? And is there another way to make this happen?

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Lookup references

Another way:

=LOOKUP(--LEFT(A2),Num,Let)


--
Biff
Microsoft Excel MVP


"mikebres" wrote in message
...
The left function returns a text value so your comparison is trying to
compare text vs a number. So you don't get a match.

Stick a value function in the formula

=LOOKUP(VALUE(LEFT(A2,1)),Num,Let)

Mike

"Ab" wrote:

Why doesn't this formula work!?!

=LOOKUP(LEFT(A1,1),NUMS,LETS)

Column A contains numbers with multiple digits.
NUMS is a list of single digit numbers (Column A in Sheet 2)
LETS is a list of letters (Column B in Sheet 2)

I want to find the first digit of the number in A1, look it up in NUMS,
and
return the corresponding value from LETS.

This works just fine as =LOOKUP(A1,NUMS,LETS) when A1 refers to a single
digit number from the NUMS list.
It also works just fine as =LOOKUP(1,NUMS,LETS) and returns the letter
that
corresponds to the number 1.
It returns #N/A when my lookup value uses the left formula.

Help? Why doesn't this work? And is there another way to make this
happen?

Thanks!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Lookup references

Just to FYI...

None of the formulas suggested will work if the number in An is negative.

However, based on your description and the formula you posted I had already
assumed there would be no negative numbers.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Another way:

=LOOKUP(--LEFT(A2),Num,Let)


--
Biff
Microsoft Excel MVP


"mikebres" wrote in message
...
The left function returns a text value so your comparison is trying to
compare text vs a number. So you don't get a match.

Stick a value function in the formula

=LOOKUP(VALUE(LEFT(A2,1)),Num,Let)

Mike

"Ab" wrote:

Why doesn't this formula work!?!

=LOOKUP(LEFT(A1,1),NUMS,LETS)

Column A contains numbers with multiple digits.
NUMS is a list of single digit numbers (Column A in Sheet 2)
LETS is a list of letters (Column B in Sheet 2)

I want to find the first digit of the number in A1, look it up in NUMS,
and
return the corresponding value from LETS.

This works just fine as =LOOKUP(A1,NUMS,LETS) when A1 refers to a single
digit number from the NUMS list.
It also works just fine as =LOOKUP(1,NUMS,LETS) and returns the letter
that
corresponds to the number 1.
It returns #N/A when my lookup value uses the left formula.

Help? Why doesn't this work? And is there another way to make this
happen?

Thanks!





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
How to maintain references when copying lookup formula [email protected] Excel Worksheet Functions 2 January 3rd 08 12:43 PM
Help with converting a block of cells with Absolute and mixed references to relative references Vulcan Excel Worksheet Functions 3 December 13th 07 11:43 PM
References And Lookup JR573PUTT Excel Discussion (Misc queries) 2 March 31st 06 06:53 AM
How to change lookup references Guy Yeakley Excel Worksheet Functions 1 January 25th 06 02:24 PM
Lookup in table with two equal references Maxtrix Excel Discussion (Misc queries) 4 December 28th 05 11:18 AM


All times are GMT +1. The time now is 02:15 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"