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

Hello Everyone

I have two worksheets if the number in sheet 1 cell B2 is in column B of
sheet 2 (say B36) I want the number in A36 to be copied to sheet one.

I have written the following but keep getting #N/A - What am I doing wrong
please?

=IF(COUNTIF(sheet 2!$B$2:$B$576,B2),VLOOKUP(B2,sheet 2!$A$2:$K$511,1,0),0)
--
Thanks as always

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

=IF(COUNTIF(sheet2!$B$2:$B$576,B2),VLOOKUP(B2,she et2!$A$2:$K$511,1,0),0)

Your row ranges aren't the same size, 576 versus 511 ?

Try this...

=IF(COUNTIF(Sheet2!B$2:B$511,B2),INDEX(Sheet2!A$2: A$511,MATCH(B2,Sheet2!B$2:B$511,0)),0)

--
Biff
Microsoft Excel MVP


"Lise" wrote in message
...
Hello Everyone

I have two worksheets if the number in sheet 1 cell B2 is in column B of
sheet 2 (say B36) I want the number in A36 to be copied to sheet one.

I have written the following but keep getting #N/A - What am I doing wrong
please?

=IF(COUNTIF(sheet 2!$B$2:$B$576,B2),VLOOKUP(B2,sheet 2!$A$2:$K$511,1,0),0)
--
Thanks as always



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

Fabulous as always Biff - thanks so much.
--
Lise


"T. Valko" wrote:

=IF(COUNTIF(sheet2!$B$2:$B$576,B2),VLOOKUP(B2,she et2!$A$2:$K$511,1,0),0)


Your row ranges aren't the same size, 576 versus 511 ?

Try this...

=IF(COUNTIF(Sheet2!B$2:B$511,B2),INDEX(Sheet2!A$2: A$511,MATCH(B2,Sheet2!B$2:B$511,0)),0)

--
Biff
Microsoft Excel MVP


"Lise" wrote in message
...
Hello Everyone

I have two worksheets if the number in sheet 1 cell B2 is in column B of
sheet 2 (say B36) I want the number in A36 to be copied to sheet one.

I have written the following but keep getting #N/A - What am I doing wrong
please?

=IF(COUNTIF(sheet 2!$B$2:$B$576,B2),VLOOKUP(B2,sheet 2!$A$2:$K$511,1,0),0)
--
Thanks as always



.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 102
Default Vlookup query

Sorry Biff I do have one more question - The below works perfectly - however
I have now realised that there may be multiple matches, is there a way to
show all of these say with a comma between or am I asking for too much??
--
Thanks as always

Lise


"Lise" wrote:

Fabulous as always Biff - thanks so much.
--
Lise


"T. Valko" wrote:

=IF(COUNTIF(sheet2!$B$2:$B$576,B2),VLOOKUP(B2,she et2!$A$2:$K$511,1,0),0)


Your row ranges aren't the same size, 576 versus 511 ?

Try this...

=IF(COUNTIF(Sheet2!B$2:B$511,B2),INDEX(Sheet2!A$2: A$511,MATCH(B2,Sheet2!B$2:B$511,0)),0)

--
Biff
Microsoft Excel MVP


"Lise" wrote in message
...
Hello Everyone

I have two worksheets if the number in sheet 1 cell B2 is in column B of
sheet 2 (say B36) I want the number in A36 to be copied to sheet one.

I have written the following but keep getting #N/A - What am I doing wrong
please?

=IF(COUNTIF(sheet 2!$B$2:$B$576,B2),VLOOKUP(B2,sheet 2!$A$2:$K$511,1,0),0)
--
Thanks as always



.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Vlookup query

is there a way to show all of these say
with a comma between


To do it that way would require a VBA UDF.

How about returning each result to its own cell? That's fairly simple. For
example:

Horizontally:

....A1........B1........C1
result1...result2...result3

Vertically:

A1 = result1
A2 = result2
A3 = result3

--
Biff
Microsoft Excel MVP


"Lise" wrote in message
...
Sorry Biff I do have one more question - The below works perfectly -
however
I have now realised that there may be multiple matches, is there a way to
show all of these say with a comma between or am I asking for too much??
--
Thanks as always

Lise


"Lise" wrote:

Fabulous as always Biff - thanks so much.
--
Lise


"T. Valko" wrote:

=IF(COUNTIF(sheet2!$B$2:$B$576,B2),VLOOKUP(B2,she et2!$A$2:$K$511,1,0),0)

Your row ranges aren't the same size, 576 versus 511 ?

Try this...

=IF(COUNTIF(Sheet2!B$2:B$511,B2),INDEX(Sheet2!A$2: A$511,MATCH(B2,Sheet2!B$2:B$511,0)),0)

--
Biff
Microsoft Excel MVP


"Lise" wrote in message
...
Hello Everyone

I have two worksheets if the number in sheet 1 cell B2 is in column B
of
sheet 2 (say B36) I want the number in A36 to be copied to sheet one.

I have written the following but keep getting #N/A - What am I doing
wrong
please?

=IF(COUNTIF(sheet 2!$B$2:$B$576,B2),VLOOKUP(B2,sheet
2!$A$2:$K$511,1,0),0)
--
Thanks as always



.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 102
Default Vlookup query

Hi Biff - sorry your #1 Pain again!!

all is working well (+ I've made some changes based on other tips from you
on previous notes) however there are still issues with duplicates.

Currently I have as an example
=IF(COUNTIF(Tasks!B$2:B$576,A59),INDEX(Tasks!A$2:A $576,MATCH(A59,Tasks!B$2:B$576,0)),"-")

On the tasks sheet row 59,60 and 61 column B are all the same which is the
same as the number listed on the current sheet in A59, A60 & A61 - but the
data I'm collecting from the tasks sheet in columns D, F & J (same rows)
change on each row which the formula isnt picking up

The formula gives the correct answer for A59 but when I drag down to use for
A60 and A61 it only provides the row 59 answers again.

Gosh I hope this makes it clearer Biff its the only way I can think to
clarify for you.

Any assistance as always appreciated


Lise


"T. Valko" wrote:

is there a way to show all of these say
with a comma between


To do it that way would require a VBA UDF.

How about returning each result to its own cell? That's fairly simple. For
example:

Horizontally:

....A1........B1........C1
result1...result2...result3

Vertically:

A1 = result1
A2 = result2
A3 = result3

--
Biff
Microsoft Excel MVP


"Lise" wrote in message
...
Sorry Biff I do have one more question - The below works perfectly -
however
I have now realised that there may be multiple matches, is there a way to
show all of these say with a comma between or am I asking for too much??
--
Thanks as always

Lise


"Lise" wrote:

Fabulous as always Biff - thanks so much.
--
Lise


"T. Valko" wrote:

=IF(COUNTIF(sheet2!$B$2:$B$576,B2),VLOOKUP(B2,she et2!$A$2:$K$511,1,0),0)

Your row ranges aren't the same size, 576 versus 511 ?

Try this...

=IF(COUNTIF(Sheet2!B$2:B$511,B2),INDEX(Sheet2!A$2: A$511,MATCH(B2,Sheet2!B$2:B$511,0)),0)

--
Biff
Microsoft Excel MVP


"Lise" wrote in message
...
Hello Everyone

I have two worksheets if the number in sheet 1 cell B2 is in column B
of
sheet 2 (say B36) I want the number in A36 to be copied to sheet one.

I have written the following but keep getting #N/A - What am I doing
wrong
please?

=IF(COUNTIF(sheet 2!$B$2:$B$576,B2),VLOOKUP(B2,sheet
2!$A$2:$K$511,1,0),0)
--
Thanks as always



.



.

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
If and Vlookup Query Lainyb Excel Discussion (Misc queries) 6 November 9th 09 02:34 PM
VLOOKUP query [email protected] Excel Worksheet Functions 6 November 10th 06 09:38 AM
IF/VLOOKUP Query SamuelT Excel Discussion (Misc queries) 2 August 4th 06 10:40 AM
VLookup query mr_teacher Excel Discussion (Misc queries) 1 May 25th 06 08:19 AM
Vlookup query gb_S49 Excel Worksheet Functions 3 January 22nd 05 12:25 PM


All times are GMT +1. The time now is 08:55 AM.

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"