Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > 2+2 Communities > Other Other Topics
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-18-2005, 04:14 PM
LondonBroil LondonBroil is offline
Senior Member
 
Join Date: Jan 2003
Posts: 576
Default Tough Excel Question

Suppose you have a spreadsheet where down the 1st column you have something like 1,1,1,1,2,2,2,2,3,3,3,3,etc. Down the 2nd column you have A,B,C,D,A,B,C,D,A,B,C,D,etc. Down the 3rd columnm you have 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, etc.

Is there a way to use the VLOOKUP function to input 2 variables, 1 from column 1 and 1 from column 2, to return the corresponding number in the 3rd column?

The problem is that I can only figure out how to input 1 variable. So if I do a =VLOOKUP(2,A2:Cx,3,FALSE), then it only returns a 0.5 because that's the number in the 3rd column that corresponds to the first number 2 in the 1st column.

If I wanted to return a 0.7, I'd need to input a 2 from the 1st column, AND a C from the 2nd column.

Any ideas?
Reply With Quote
  #2  
Old 08-18-2005, 04:21 PM
cbfair cbfair is offline
Senior Member
 
Join Date: Sep 2004
Posts: 206
Default Re: Tough Excel Question

jeebus, that is a tough question!
Reply With Quote
  #3  
Old 08-18-2005, 04:24 PM
davelin davelin is offline
Senior Member
 
Join Date: Aug 2004
Posts: 708
Default Re: Tough Excel Question

You could create a fourth column that is the combination of the first two and do a VLOOKUP on that column. Am I misunderstanding your question?
Reply With Quote
  #4  
Old 08-18-2005, 04:25 PM
Soul Daddy Soul Daddy is offline
Senior Member
 
Join Date: Oct 2004
Location: Hurricanes, animal corpses and your potential new tattoo have a lot in common. Think about it.
Posts: 463
Default Re: Tough Excel Question

[ QUOTE ]
You could create a fourth column that is the combination of the first two and do a VLOOKUP on that column.

[/ QUOTE ]
Yes. "&" is your friend.
Reply With Quote
  #5  
Old 08-18-2005, 04:26 PM
TheWorstPlayer TheWorstPlayer is offline
Senior Member
 
Join Date: Dec 2004
Location: Boring work = post too much
Posts: 2,435
Default Re: Tough Excel Question

[ QUOTE ]
You could create a fourth column that is the combination of the first two and do a VLOOKUP on that column. Am I misunderstanding your question?

[/ QUOTE ]
This is the correct answer. If for some reason you cannot manipulate the data, then you can get funky with array functions instead. But usually, you should just create a new column in front of your data table called ID or Index or Key or whatever and just concatenate the two columns that you want to look up. Then just look up the concatenation.
Reply With Quote
  #6  
Old 08-18-2005, 04:31 PM
maryfield48 maryfield48 is offline
Senior Member
 
Join Date: May 2004
Location: Kingston, Jamaica
Posts: 144
Default Re: Tough Excel Question

[ QUOTE ]
You could create a fourth column that is the combination of the first two and do a VLOOKUP on that column. Am I misunderstanding your question?

[/ QUOTE ]

And you have to sort the data by that column, I believe.
Reply With Quote
  #7  
Old 08-18-2005, 04:35 PM
TheWorstPlayer TheWorstPlayer is offline
Senior Member
 
Join Date: Dec 2004
Location: Boring work = post too much
Posts: 2,435
Default Re: Tough Excel Question

[ QUOTE ]
[ QUOTE ]
You could create a fourth column that is the combination of the first two and do a VLOOKUP on that column. Am I misunderstanding your question?

[/ QUOTE ]

And you have to sort the data by that column, I believe.

[/ QUOTE ]
For a real vlookup, this is true. Which is why it is often preferable to use Index(DataColumn, Match(LookupValue, KeyColumn,0),false) instead of a true vlookup. The Index and Match functions are also more flexible than vlookups.
Reply With Quote
  #8  
Old 08-18-2005, 04:41 PM
davelin davelin is offline
Senior Member
 
Join Date: Aug 2004
Posts: 708
Default Re: Tough Excel Question

[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
You could create a fourth column that is the combination of the first two and do a VLOOKUP on that column. Am I misunderstanding your question?

[/ QUOTE ]

And you have to sort the data by that column, I believe.

[/ QUOTE ]
For a real vlookup, this is true. Which is why it is often preferable to use Index(DataColumn, Match(LookupValue, KeyColumn,0),false) instead of a true vlookup. The Index and Match functions are also more flexible than vlookups.

[/ QUOTE ]

Interesting, although I know excel says it needs to be sorted as a default, I've never run into a problem using vlookup's on unsorted tables.
Reply With Quote
  #9  
Old 08-18-2005, 04:54 PM
TheWorstPlayer TheWorstPlayer is offline
Senior Member
 
Join Date: Dec 2004
Location: Boring work = post too much
Posts: 2,435
Default Re: Tough Excel Question

[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
You could create a fourth column that is the combination of the first two and do a VLOOKUP on that column. Am I misunderstanding your question?

[/ QUOTE ]

And you have to sort the data by that column, I believe.

[/ QUOTE ]
For a real vlookup, this is true. Which is why it is often preferable to use Index(DataColumn, Match(LookupValue, KeyColumn,0),false) instead of a true vlookup. The Index and Match functions are also more flexible than vlookups.

[/ QUOTE ]

Interesting, although I know excel says it needs to be sorted as a default, I've never run into a problem using vlookup's on unsorted tables.

[/ QUOTE ]
I'm pretty sure that I have and can try to construct an example if you want. But I mainly use Index and Match when I want to do funkier stuff that vlookups won't easily accomodate.
Reply With Quote
  #10  
Old 08-18-2005, 04:55 PM
maryfield48 maryfield48 is offline
Senior Member
 
Join Date: May 2004
Location: Kingston, Jamaica
Posts: 144
Default Re: Tough Excel Question

[ QUOTE ]
And you have to sort the data by that column, I believe.

[/ QUOTE ]

For a real vlookup, this is true. Which is why it is often preferable to use Index(DataColumn, Match(LookupValue, KeyColumn,0),false) instead of a true vlookup. The Index and Match functions are also more flexible than vlookups.

[/ QUOTE ]

I'm so glad I came into this thread. I've learnt something that will be very useful.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:38 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.