Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 39
Default Lookup returning one more than expected

Hi,

I am using a formula to return multiple values relating to a single value ie
Sheet5
CA CB
001 John, Smit
001 Jane Seymore
001 John
002 Chris

Workings sheet returns:

001 John, Smit
001 Jane Seymore
001 John
002 Chris
- -

The problem I get is that one extra value ie Chris being returned even
though Chris does not fall in the criteria(001).

=IF(ISERROR(INDEX(Sheet5!$A$2:$B$185,SMALL(IF(Shee t5!$A$2:$A$185=Workings!$B$6,ROW(Sheet5!$A$2:$A$18 5)),ROW(1:1)),2)),"-",INDEX(Sheet5!$A$2:$B$185,SMALL(IF(Sheet5!$A$2:$A $185=Workings!$B$6,ROW(Sheet5!$A$2:$A$185)),ROW(1: 1)),2))

Please let me know if there is something I can do
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Lookup returning one more than expected

Try this (array entered):

=IF(ROWS($1:1)<=COUNTIF(Sheet5!$A$2:$A$185,Working s!$B$6),INDEX(Sheet5!$B$2:$B$185,SMALL(IF(Sheet5!$ A$2:$A$185=Workings!$B$6,ROW(A$2:A$185)-ROW(A$2)+1),ROWS($1:1))),"-")

Biff

"Victor" wrote in message
...
Hi,

I am using a formula to return multiple values relating to a single value
ie
Sheet5
CA CB
001 John, Smit
001 Jane Seymore
001 John
002 Chris

Workings sheet returns:

001 John, Smit
001 Jane Seymore
001 John
002 Chris
- -

The problem I get is that one extra value ie Chris being returned even
though Chris does not fall in the criteria(001).

=IF(ISERROR(INDEX(Sheet5!$A$2:$B$185,SMALL(IF(Shee t5!$A$2:$A$185=Workings!$B$6,ROW(Sheet5!$A$2:$A$18 5)),ROW(1:1)),2)),"-",INDEX(Sheet5!$A$2:$B$185,SMALL(IF(Sheet5!$A$2:$A $185=Workings!$B$6,ROW(Sheet5!$A$2:$A$185)),ROW(1: 1)),2))

Please let me know if there is something I can do



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 39
Default Lookup returning one more than expected

Thanks Biff

Works 100%!

"Biff" wrote:

Try this (array entered):

=IF(ROWS($1:1)<=COUNTIF(Sheet5!$A$2:$A$185,Working s!$B$6),INDEX(Sheet5!$B$2:$B$185,SMALL(IF(Sheet5!$ A$2:$A$185=Workings!$B$6,ROW(A$2:A$185)-ROW(A$2)+1),ROWS($1:1))),"-")

Biff

"Victor" wrote in message
...
Hi,

I am using a formula to return multiple values relating to a single value
ie
Sheet5
CA CB
001 John, Smit
001 Jane Seymore
001 John
002 Chris

Workings sheet returns:

001 John, Smit
001 Jane Seymore
001 John
002 Chris
- -

The problem I get is that one extra value ie Chris being returned even
though Chris does not fall in the criteria(001).

=IF(ISERROR(INDEX(Sheet5!$A$2:$B$185,SMALL(IF(Shee t5!$A$2:$A$185=Workings!$B$6,ROW(Sheet5!$A$2:$A$18 5)),ROW(1:1)),2)),"-",INDEX(Sheet5!$A$2:$B$185,SMALL(IF(Sheet5!$A$2:$A $185=Workings!$B$6,ROW(Sheet5!$A$2:$A$185)),ROW(1: 1)),2))

Please let me know if there is something I can do




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Lookup returning one more than expected

You're welcome. Thanks for the feedback!

Biff

"Victor" wrote in message
...
Thanks Biff

Works 100%!

"Biff" wrote:

Try this (array entered):

=IF(ROWS($1:1)<=COUNTIF(Sheet5!$A$2:$A$185,Working s!$B$6),INDEX(Sheet5!$B$2:$B$185,SMALL(IF(Sheet5!$ A$2:$A$185=Workings!$B$6,ROW(A$2:A$185)-ROW(A$2)+1),ROWS($1:1))),"-")

Biff

"Victor" wrote in message
...
Hi,

I am using a formula to return multiple values relating to a single
value
ie
Sheet5
CA CB
001 John, Smit
001 Jane Seymore
001 John
002 Chris

Workings sheet returns:

001 John, Smit
001 Jane Seymore
001 John
002 Chris
- -

The problem I get is that one extra value ie Chris being returned even
though Chris does not fall in the criteria(001).

=IF(ISERROR(INDEX(Sheet5!$A$2:$B$185,SMALL(IF(Shee t5!$A$2:$A$185=Workings!$B$6,ROW(Sheet5!$A$2:$A$18 5)),ROW(1:1)),2)),"-",INDEX(Sheet5!$A$2:$B$185,SMALL(IF(Sheet5!$A$2:$A $185=Workings!$B$6,ROW(Sheet5!$A$2:$A$185)),ROW(1: 1)),2))

Please let me know if there is something I can do






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
LOOKUP function not returning expected value - Using vector_lookup format JerichoForce Excel Worksheet Functions 2 April 18th 06 10:45 AM
Excel 2002 Lookup formula returning wrong results? Val Excel Worksheet Functions 1 November 18th 05 09:07 PM
LOOKUP returning value in cell above what I was searching for mwrfsu Excel Discussion (Misc queries) 2 September 10th 05 06:25 PM
Returning expected dates London Excel Worksheet Functions 1 July 23rd 05 03:31 AM
Lookup function returning reference, not value Caligula Excel Worksheet Functions 1 May 28th 05 06:35 PM


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