#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default vlookup maybe

I have a spreadsheet that has data in a column of cells that have both
numbers and letters (ABCD 123456) that shoud match data in one of two tabs in
the same worksheet. What I'm trying to do is have a forumla look at the
information in the first tab match it to the same matching information in the
other tabs and depending on which of the two tabs in finds the information in
will return a answer. I've been playing with the vlookup and can get a
formula to look at one sheet and return the right answer, but I can't get a
formula to look at both sheets and return the right answer.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default vlookup maybe

Hi,
If the matching data is only present in one or the other the 2 sheets, (ie,
not both) and if you are using FALSE (or 0) as your 4th argument in your
VLOOKUP's, you could try something like this:

IF(ISNA(VLOOKUP(1st Sheet Lookup Details),VLOOKUP(2nd Sheet Lookup
Details),VLOOKUP(1st Sheet Lookup details))

When using FALSE (or 0) as your 4th argument, VLOOKUP returns a #N/A when
its lookup value is not found.

Regards - Dave.

"gman1964" wrote:

I have a spreadsheet that has data in a column of cells that have both
numbers and letters (ABCD 123456) that shoud match data in one of two tabs in
the same worksheet. What I'm trying to do is have a forumla look at the
information in the first tab match it to the same matching information in the
other tabs and depending on which of the two tabs in finds the information in
will return a answer. I've been playing with the vlookup and can get a
formula to look at one sheet and return the right answer, but I can't get a
formula to look at both sheets and return the right answer.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 353
Default vlookup maybe

If the value is definitly on one of the two sheets and only on one of the two
sheets - this formula has no provision for a value with no match and will
return #N/A in that case...

=VLOOKUP(A2,IF(LOOKUP(A2,DataSheet!$A$2:$A$30)=A2, DataSheet!$A$2:$B$30,DataSheet2!$A$2:$B$30),2,0)

where A2 contains the value to lookup...
if lookup finds a matching value in the first column of data in the first
data sheet:
LOOKUP(A2,DataSheet!$A$2:$A$26)=A2
then the table for lookup would be that sheet:
DataSheet!$A$2:$B$26
if not, it will be the second sheet:
DataSheet2!$A$2:$B$30
In this example, returning data from the second column when there is an
exact match...
substitute as necessary.


"gman1964" wrote:

I have a spreadsheet that has data in a column of cells that have both
numbers and letters (ABCD 123456) that shoud match data in one of two tabs in
the same worksheet. What I'm trying to do is have a forumla look at the
information in the first tab match it to the same matching information in the
other tabs and depending on which of the two tabs in finds the information in
will return a answer. I've been playing with the vlookup and can get a
formula to look at one sheet and return the right answer, but I can't get a
formula to look at both sheets and return the right answer.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default vlookup maybe

LOOKUP requires the lookup_vector be sorted in ascending order.

Try this:

=VLOOKUP(A1,IF(COUNTIF(Sheet2!A1:A5,A1),Sheet2!A1: B5,Sheet3!A1:B5),2,0)

--
Biff
Microsoft Excel MVP


"BoniM" wrote in message
...
If the value is definitly on one of the two sheets and only on one of the
two
sheets - this formula has no provision for a value with no match and will
return #N/A in that case...

=VLOOKUP(A2,IF(LOOKUP(A2,DataSheet!$A$2:$A$30)=A2, DataSheet!$A$2:$B$30,DataSheet2!$A$2:$B$30),2,0)

where A2 contains the value to lookup...
if lookup finds a matching value in the first column of data in the first
data sheet:
LOOKUP(A2,DataSheet!$A$2:$A$26)=A2
then the table for lookup would be that sheet:
DataSheet!$A$2:$B$26
if not, it will be the second sheet:
DataSheet2!$A$2:$B$30
In this example, returning data from the second column when there is an
exact match...
substitute as necessary.


"gman1964" wrote:

I have a spreadsheet that has data in a column of cells that have both
numbers and letters (ABCD 123456) that shoud match data in one of two
tabs in
the same worksheet. What I'm trying to do is have a forumla look at the
information in the first tab match it to the same matching information in
the
other tabs and depending on which of the two tabs in finds the
information in
will return a answer. I've been playing with the vlookup and can get a
formula to look at one sheet and return the right answer, but I can't get
a
formula to look at both sheets and return the right answer.



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
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
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(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:29 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"