#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 193
Default Vlookup

Is it possible to have two vlookups in one cell? I am have a datasheet where
the city and state are in two columns. In another worksheet is a specific
template where if I input the employee name, the template would automatically
populate the data related to that employee. The problem is, in the template,
the city and state are shown in the same cell. Not sure if vlookup can do
this.

please help. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Vlookup

You can use something like this (based on your other lookup post):

Assume CITY is in column 2 of "database" and STATE is in column 3 of
"database".

=IF(ISNUMBER(MATCH(B2,INDEX(database,,1),0)),
VLOOKUP(B2,database,2,0)&", "&
VLOOKUP(B2,database,3,0),"")

This will return in the same cell:

City, State

Biff

"Confused" wrote in message
...
Is it possible to have two vlookups in one cell? I am have a datasheet
where
the city and state are in two columns. In another worksheet is a specific
template where if I input the employee name, the template would
automatically
populate the data related to that employee. The problem is, in the
template,
the city and state are shown in the same cell. Not sure if vlookup can do
this.

please help. Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 663
Default Vlookup

Hi,

Please go through this information:

VLOOKUP

Searches for a value in the first column of a table array and returns a
value in the same row from another column in the table array.

The V in VLOOKUP stands for vertical. Use VLOOKUP instead of HLOOKUP when
your comparison values are located in a column to the left of the data that
you want to find.

Syntax
VLOOKUP(lookup_value,table_array,col_index_num,ran ge_lookup)

Lookup_value The value to search in the first column of the table array
(array: Used to build single formulas that produce multiple results or that
operate on a group of arguments that are arranged in rows and columns. An
array range shares a common formula; an array constant is a group of
constants used as an argument.). Lookup_value can be a value or a reference.
If lookup_value is smaller than the smallest value in the first column of
table_array, VLOOKUP returns the #N/A error value.

Table_array Two or more columns of data. Use a reference to a range or a
range name. The values in the first column of table_array are the values
searched by lookup_value. These values can be text, numbers, or logical
values. Uppercase and lowercase text are equivalent.

Col_index_num The column number in table_array from which the matching
value must be returned. A col_index_num of 1 returns the value in the first
column in table_array; a col_index_num of 2 returns the value in the second
column in table_array, and so on. If col_index_num is:

Less than 1, VLOOKUP returns the #VALUE! error value.
Greater than the number of columns in table_array, VLOOKUP returns the #REF!
error value.
Range_lookup A logical value that specifies whether you want VLOOKUP to
find an exact match or an approximate match:

If TRUE or omitted, an exact or approximate match is returned. If an exact
match is not found, the next largest value that is less than lookup_value is
returned.
The values in the first column of table_array must be placed in ascending
sort order; otherwise, VLOOKUP may not give the correct value. You can put
the values in ascending order by choosing the Sort command from the Data menu
and selecting Ascending. For more information, see Default sort orders.

If FALSE, VLOOKUP will only find an exact match. In this case, the values in
the first column of table_array do not need to be sorted. If there are two or
more values in the first column of table_array that match the lookup_value,
the first value found is used. If an exact match is not found, the error
value #N/A is returned.
Remarks
When searching text values in the first column of table_array, ensure that
the data in the first column of table_array does not have leading spaces,
trailing spaces, inconsistent use of straight ( ' or " ) and curly ( €˜ or €œ)
quotation marks, or nonprinting characters. In these cases, VLOOKUP may give
an incorrect or unexpected value. For more information on functions that you
can use to clean text data, see Text and Data functions.
When searching number or date values, ensure that the data in the first
column of table_array is not stored as text values. In this case, VLOOKUP may
give an incorrect or unexpected value. For more information, see Convert
numbers stored as text to numbers.
If range_lookup is FALSE and lookup_value is text, then you can use the
wildcard characters, question mark (?) and asterisk (*), in lookup_value. A
question mark matches any single character; an asterisk matches any sequence
of characters. If you want to find an actual question mark or asterisk, type
a tilde (~) preceding the character.

Challa Prabhu

"Confused" wrote:

Is it possible to have two vlookups in one cell? I am have a datasheet where
the city and state are in two columns. In another worksheet is a specific
template where if I input the employee name, the template would automatically
populate the data related to that employee. The problem is, in the template,
the city and state are shown in the same cell. Not sure if vlookup can do
this.

please help. 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
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) MikeR-Oz New Users to Excel 1 March 22nd 06 09:01 AM
IF(a1="x",(vlookup 18K rows,2,false),(vlookup 18K,3,false)) RAM? bchilt Excel Worksheet Functions 6 January 20th 06 09:21 AM
IF(AND(val1=VLOOKUP( );val2>=VLOOKUP( );val2<=VLOOKUP( );VLOOKUP( Oso Excel Worksheet Functions 2 January 26th 05 06:56 AM
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM


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