#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default If and VLOOKUP Query

Hi guys, I am trying to use an IF statement with a VLOOKUP function to return
data based on one of two criteris ,, e.g. column A is where I want to place
the formula, column B is the first criteria, column C is the 2nd criteria
,,,, what I want to see in column A is the result from doing a VLOOKUP on
column B ( using a matrix ) and if the return data is "Unknown" then VLOOKUP
column C and return the result form the same matrix ,,,, i.e.
If(VLOOKUP(B1,Matrix,2,0)="Unknown",Vlookup(C1,mat rix,2,0) ...... anyone know
of an easy solution?
A B C
nuts Bolts
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default If and VLOOKUP Query

You have the right idea. You just need to finish it:

=IF(VLOOKUP(B1,Matrix,2,0)="Unknown",VLOOKUP(C1,Ma trix,2,0),VLOOKUP(B1,Matrix,2,0))--BiffMicrosoft Excel MVP"John Moore" wrote in ... Hi guys, I am trying to use an IF statement with a VLOOKUP function toreturn data based on one of two criteris ,, e.g. column A is where I want toplace the formula, column B is the first criteria, column C is the 2nd criteria ,,,, what I want to see in column A is the result from doing a VLOOKUP on column B ( using a matrix ) and if the return data is "Unknown" thenVLOOKUP column C and return the result form the same matrix ,,,, i.e. If(VLOOKUP(B1,Matrix,2,0)="Unknown",Vlookup(C1,mat rix,2,0) ...... anyoneknow of an easy solution? A B C nuts Bolts

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default If and VLOOKUP Query

Yikes! I have no idea how that reply got all jammed together like that. Here
it is again:

You have the right idea. You just need to finish it:

=IF(VLOOKUP(B1,Matrix,2,0)="Unknown",VLOOKUP(C1,Ma trix,2,0),VLOOKUP(B1,Matrix,2,0))--

--
Biff
Microsoft Excel MVP


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default If and VLOOKUP Query

you can use either countif or isna to determine if your vlookup is going to
find a value so in general here is the theory of what you want

if(countif(A1:A100, "Apple")<0, vlookup("apple", A1:D100, 4, false),
if(countif(B1:B100, "Orange") < 0, Vlookup("Orange", B1:D100, 3, False),
"NA"))

ISNA would be similar but in general
if(isna(vlookup(...), Not found, vlookup(...))
--
HTH...

Jim Thomlinson


"John Moore" wrote:

Hi guys, I am trying to use an IF statement with a VLOOKUP function to return
data based on one of two criteris ,, e.g. column A is where I want to place
the formula, column B is the first criteria, column C is the 2nd criteria
,,,, what I want to see in column A is the result from doing a VLOOKUP on
column B ( using a matrix ) and if the return data is "Unknown" then VLOOKUP
column C and return the result form the same matrix ,,,, i.e.
If(VLOOKUP(B1,Matrix,2,0)="Unknown",Vlookup(C1,mat rix,2,0) ...... anyone know
of an easy solution?
A B C
nuts Bolts

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default If and VLOOKUP Query

this ..?

=IF(ISNA(VLOOKUP(B1,matrix,2,0)),IF(ISNA(VLOOKUP(C 1,matrix,2,0)),"Unknown",VLOOKUP(C1,matrix,2,0)),V LOOKUP(B1,matrix,2,0))

"John Moore" wrote:

Hi guys, I am trying to use an IF statement with a VLOOKUP function to return
data based on one of two criteris ,, e.g. column A is where I want to place
the formula, column B is the first criteria, column C is the 2nd criteria
,,,, what I want to see in column A is the result from doing a VLOOKUP on
column B ( using a matrix ) and if the return data is "Unknown" then VLOOKUP
column C and return the result form the same matrix ,,,, i.e.
If(VLOOKUP(B1,Matrix,2,0)="Unknown",Vlookup(C1,mat rix,2,0) ...... anyone know
of an easy solution?
A B C
nuts Bolts

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 query [email protected] Excel Worksheet Functions 6 November 10th 06 09:38 AM
VLOOKUP QUERY John Moore Excel Discussion (Misc queries) 6 June 22nd 06 10:05 PM
VLOOKUP Query blain Excel Worksheet Functions 2 June 17th 06 03:09 PM
Vlookup query Tester Excel Worksheet Functions 2 December 2nd 05 11:39 PM
Vlookup or If query sydolly Excel Discussion (Misc queries) 1 September 10th 05 03:13 PM


All times are GMT +1. The time now is 07:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"