#11
|
|||
|
|||
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. |
#12
|
|||
|
|||
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 ] My sister is having this problem. The first column is actually tubing outside diamter (e.g. 0.25 inches) and the 2nd column isn't letters, it's tubing guage (e.g. "20" guage). I was not aware of this before since she just sent me a "basic" version of the table that had letters instead of numbers in column 2. So if we made a 4th column and combined them, it would look like 0.2520 which doesn't make sense. She wants the values in column A and B to be user inputed and have it spit out the corresponding C column value. And to the other person who mentioned having the 2nd column as a row. She mentioned she COULD do it that way, but she wants to keep it set up the way it is. |
#13
|
|||
|
|||
Re: Tough Excel Question
Could you still create your 4th column, create a cell which is the combination of two user-inputed numbers, and the do a lookup on that cell?
|
#14
|
|||
|
|||
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 ] My sister is having this problem. The first column is actualy tubing outside diamter (e.g. 0.25 inches) and the 2nd column isn't letters, it's tubing guage (e.g. "20" guage). So if we made a 4th column and combined them, it would look like 0.2520 which doesn't make sense. She wants the values in column A and B to be user inputed and have it spit out the corresponding C column value. This is a real pain. [/ QUOTE ] It doesn't have to make sense, it will still work. Let's say you add a column that concatenates the contents of cell A2 [i.e. .25] and the contents of cell B2 [i.e. 20] as ".25/20" [The formula would read =concatenate(a2&"/"&b2)] You could have the user input the value they need [.25/20] into another cell, say G2, and in G3 you have the formula =vlookup(G2,table_array,4,FALSE) to return the required value. The user would just have to know the correct syntax, i.e. outside diameter/guage. |
#15
|
|||
|
|||
Re: Tough Excel Question
Same as before. Just to make sure that 2&232 looks different from 22&32, add an underscore or something so your formula will look like =a1&"_"&b1 for your index column.
|
#16
|
|||
|
|||
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. |
#17
|
|||
|
|||
Re: Tough Excel Question
Man... just use Matlab instead.
|
#18
|
|||
|
|||
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. |
#19
|
|||
|
|||
Re: Tough Excel Question
[ QUOTE ]
[ 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. [/ QUOTE ] At work, I get paid for giving Excel training. [img]/images/graemlins/tongue.gif[/img] |
#20
|
|||
|
|||
Re: Tough Excel Question
[ QUOTE ]
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? [/ QUOTE ] Concatenate the columns into a long string and vlookup that. |
|
|