Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default can't lookup a value to the left of my variable

I cannot figure out how to return the value of a cell to the left of my
reference. For example I have a table that looks like this....
A B C
1Bob 1 5
2John 2 6
3Tom 3 7
4Tim 4 8

I need to find the number 7 in column C and return the value of the cell in
column A with the same row number. Make sense? i tried something like this:
=LOOKUP(7, C1:C4, A1:A4) but that keeps returning the wrong value. also,
column A is not and cannot be sorted alphabetically.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 72
Default can't lookup a value to the left of my variable

Does it have to be set up in that order.. like could you have a table C A B
with your values? The reason I'm asing is because you could use a vlookup but
that only looks at the leftmost column of your table.

"Gluefoot" wrote:

I cannot figure out how to return the value of a cell to the left of my
reference. For example I have a table that looks like this....
A B C
1Bob 1 5
2John 2 6
3Tom 3 7
4Tim 4 8

I need to find the number 7 in column C and return the value of the cell in
column A with the same row number. Make sense? i tried something like this:
=LOOKUP(7, C1:C4, A1:A4) but that keeps returning the wrong value. also,
column A is not and cannot be sorted alphabetically.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,440
Default can't lookup a value to the left of my variable

=INDEX(A1:A4,MATCH(7,C1:C4,0))

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Gluefoot" wrote in message ...
|I cannot figure out how to return the value of a cell to the left of my
| reference. For example I have a table that looks like this....
| A B C
| 1Bob 1 5
| 2John 2 6
| 3Tom 3 7
| 4Tim 4 8
|
| I need to find the number 7 in column C and return the value of the cell in
| column A with the same row number. Make sense? i tried something like this:
| =LOOKUP(7, C1:C4, A1:A4) but that keeps returning the wrong value. also,
| column A is not and cannot be sorted alphabetically.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default can't lookup a value to the left of my variable

unfortunately yes, it has to be in that order.

"JBoyer" wrote:

Does it have to be set up in that order.. like could you have a table C A B
with your values? The reason I'm asing is because you could use a vlookup but
that only looks at the leftmost column of your table.

"Gluefoot" wrote:

I cannot figure out how to return the value of a cell to the left of my
reference. For example I have a table that looks like this....
A B C
1Bob 1 5
2John 2 6
3Tom 3 7
4Tim 4 8

I need to find the number 7 in column C and return the value of the cell in
column A with the same row number. Make sense? i tried something like this:
=LOOKUP(7, C1:C4, A1:A4) but that keeps returning the wrong value. also,
column A is not and cannot be sorted alphabetically.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default can't lookup a value to the left of my variable

=index(a1:a4,match(7,c1:c4,0))

Debra Dalgleish has lots of notes on =vlookup() and =index(match()) he
http://www.contextures.com/xlFunctions02.html (for =vlookup())
and
http://www.contextures.com/xlFunctions03.html (for =index(match()))
and
http://contextures.com/xlFunctions02.html#Trouble

Gluefoot wrote:

I cannot figure out how to return the value of a cell to the left of my
reference. For example I have a table that looks like this....
A B C
1Bob 1 5
2John 2 6
3Tom 3 7
4Tim 4 8

I need to find the number 7 in column C and return the value of the cell in
column A with the same row number. Make sense? i tried something like this:
=LOOKUP(7, C1:C4, A1:A4) but that keeps returning the wrong value. also,
column A is not and cannot be sorted alphabetically.


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 72
Default can't lookup a value to the left of my variable

The function you asked about should also work though too, I was just
proposing a new idea. I would check the formatting of the cells you are
looking up and the cell you are entering the formula into. you could also try
to do something like this just to see if it works. in a5 enter 7 and in b5
enter your formula =LOOKUP(A5, C1:C4, A1:A4)

"Gluefoot" wrote:

unfortunately yes, it has to be in that order.

"JBoyer" wrote:

Does it have to be set up in that order.. like could you have a table C A B
with your values? The reason I'm asing is because you could use a vlookup but
that only looks at the leftmost column of your table.

"Gluefoot" wrote:

I cannot figure out how to return the value of a cell to the left of my
reference. For example I have a table that looks like this....
A B C
1Bob 1 5
2John 2 6
3Tom 3 7
4Tim 4 8

I need to find the number 7 in column C and return the value of the cell in
column A with the same row number. Make sense? i tried something like this:
=LOOKUP(7, C1:C4, A1:A4) but that keeps returning the wrong value. also,
column A is not and cannot be sorted alphabetically.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default can't lookup a value to the left of my variable

Others have given you a formula that works, the reason that your formula
failed is because as it says in Help:

"Important The values in lookup_vector must be placed in ascending order:
....,-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP may not give
the correct value."

Because your sample was ascending it does work with the sample data but may
not with real data.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gluefoot" wrote in message
...
I cannot figure out how to return the value of a cell to the left of my
reference. For example I have a table that looks like this....
A B C
1Bob 1 5
2John 2 6
3Tom 3 7
4Tim 4 8

I need to find the number 7 in column C and return the value of the cell
in
column A with the same row number. Make sense? i tried something like
this:
=LOOKUP(7, C1:C4, A1:A4) but that keeps returning the wrong value. also,
column A is not and cannot be sorted alphabetically.



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
lookup left Mottyb Excel Worksheet Functions 2 November 22nd 07 07:35 PM
Variable Lookup/Double Lookup Ryan[_2_] Excel Worksheet Functions 8 May 14th 07 09:44 PM
Lookup to the Left tuph Excel Worksheet Functions 2 July 28th 06 11:11 PM
Lookup to the Left tuph Excel Worksheet Functions 0 July 28th 06 03:15 AM
lookup/left via135 Excel Worksheet Functions 3 May 3rd 06 02:43 PM


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