Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Using a Vlookup within an IF formula

I'm trying to get a Vlookup to look at certain parts of a Wooksheet and tell
me if a person is in it or not and return a specific value if they are or
arent. I can get it to return the value for if they are, but if they arent
it comes back with #N/A

Can anyone please help this is doing my head in!!!

Cheers
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Using a Vlookup within an IF formula

The usual way of doing this is along the lines of:

=IF(ISNA(your_lookup_formula),"",your_lookup_formu la)

i.e. if there is an error in the lookup then return an empty string
(blank), otherwise do the lookup. You could change the "" to some error
message like "absent".

Hope this helps.

Pete

Balticjo wrote:

I'm trying to get a Vlookup to look at certain parts of a Wooksheet and tell
me if a person is in it or not and return a specific value if they are or
arent. I can get it to return the value for if they are, but if they arent
it comes back with #N/A

Can anyone please help this is doing my head in!!!

Cheers


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Using a Vlookup within an IF formula

Sorry should have said this is what i'm using at the moment

=IF(VLOOKUP(A159,'1st'!$I:$I,1,FALSE)=A159,"W","A" )

"Balticjo" wrote:

I'm trying to get a Vlookup to look at certain parts of a Wooksheet and tell
me if a person is in it or not and return a specific value if they are or
arent. I can get it to return the value for if they are, but if they arent
it comes back with #N/A

Can anyone please help this is doing my head in!!!

Cheers

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Using a Vlookup within an IF formula

Ok, try this variation of it:

=IF(ISNA(VLOOKUP(A159,'1st'!$I:$I,1,0)),"not
present",IF(VLOOKUP(A159,'1st'!$I:$I,1,0)=A159,"W" ,"A"))

Hope this helps.

Pete

Balticjo wrote:

Sorry should have said this is what i'm using at the moment

=IF(VLOOKUP(A159,'1st'!$I:$I,1,FALSE)=A159,"W","A" )

"Balticjo" wrote:

I'm trying to get a Vlookup to look at certain parts of a Wooksheet and tell
me if a person is in it or not and return a specific value if they are or
arent. I can get it to return the value for if they are, but if they arent
it comes back with #N/A

Can anyone please help this is doing my head in!!!

Cheers


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Using a Vlookup within an IF formula

Sorry, I think what you want is:

=IF(ISNA(VLOOKUP(A159,'1st'!$I:$I,1,0)),"A","W")

i.e. if A159 is not in the table return "A", if it is in the table then
return "W"

Hope this helps.

Pete


Pete_UK wrote:

Ok, try this variation of it:

=IF(ISNA(VLOOKUP(A159,'1st'!$I:$I,1,0)),"not
present",IF(VLOOKUP(A159,'1st'!$I:$I,1,0)=A159,"W" ,"A"))

Hope this helps.

Pete

Balticjo wrote:

Sorry should have said this is what i'm using at the moment

=IF(VLOOKUP(A159,'1st'!$I:$I,1,FALSE)=A159,"W","A" )

"Balticjo" wrote:

I'm trying to get a Vlookup to look at certain parts of a Wooksheet and tell
me if a person is in it or not and return a specific value if they are or
arent. I can get it to return the value for if they are, but if they arent
it comes back with #N/A

Can anyone please help this is doing my head in!!!

Cheers




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Using a Vlookup within an IF formula

Worked a Treat

Much Appreciated!!!

"Pete_UK" wrote:

Ok, try this variation of it:

=IF(ISNA(VLOOKUP(A159,'1st'!$I:$I,1,0)),"not
present",IF(VLOOKUP(A159,'1st'!$I:$I,1,0)=A159,"W" ,"A"))

Hope this helps.

Pete

Balticjo wrote:

Sorry should have said this is what i'm using at the moment

=IF(VLOOKUP(A159,'1st'!$I:$I,1,FALSE)=A159,"W","A" )

"Balticjo" wrote:

I'm trying to get a Vlookup to look at certain parts of a Wooksheet and tell
me if a person is in it or not and return a specific value if they are or
arent. I can get it to return the value for if they are, but if they arent
it comes back with #N/A

Can anyone please help this is doing my head in!!!

Cheers



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Using a Vlookup within an IF formula

Thanks for the feedback.

Pete

Balticjo wrote:

Worked a Treat

Much Appreciated!!!

"Pete_UK" wrote:

Ok, try this variation of it:

=IF(ISNA(VLOOKUP(A159,'1st'!$I:$I,1,0)),"not
present",IF(VLOOKUP(A159,'1st'!$I:$I,1,0)=A159,"W" ,"A"))

Hope this helps.

Pete

Balticjo wrote:

Sorry should have said this is what i'm using at the moment

=IF(VLOOKUP(A159,'1st'!$I:$I,1,FALSE)=A159,"W","A" )

"Balticjo" wrote:

I'm trying to get a Vlookup to look at certain parts of a Wooksheet and tell
me if a person is in it or not and return a specific value if they are or
arent. I can get it to return the value for if they are, but if they arent
it comes back with #N/A

Can anyone please help this is doing my head in!!!

Cheers




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 287
Default Using a Vlookup within an IF formula

If you're not returning a value but just checking whether an item exists in a
list then MATCH would be better:

=IF(ISNA(MATCH(A159,'1st'!$I:$I,0)),"A","W")

"Balticjo" wrote:

Sorry should have said this is what i'm using at the moment

=IF(VLOOKUP(A159,'1st'!$I:$I,1,FALSE)=A159,"W","A" )

"Balticjo" wrote:

I'm trying to get a Vlookup to look at certain parts of a Wooksheet and tell
me if a person is in it or not and return a specific value if they are or
arent. I can get it to return the value for if they are, but if they arent
it comes back with #N/A

Can anyone please help this is doing my head in!!!

Cheers

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
How to copy a vlookup formula without changing the "table_array" p not 2 excell Excel Worksheet Functions 5 April 17th 23 07:03 PM
VLOOKUP Formula vishu Excel Discussion (Misc queries) 3 March 21st 06 12:49 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
IF & VLOOKUP FORMULA taxmom Excel Worksheet Functions 3 March 2nd 05 03:35 PM


All times are GMT +1. The time now is 01:44 PM.

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"