Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
luvthavodka
 
Posts: n/a
Default VLOOKUP - more than one return required

My range of data (table array) has more than one row that meet the VLOOKUP
criteria I have set.

I have a VLOOKUP in eg A1 =VLOOKUP($K$1,Order_Log,6,FALSE). In this I want
the first value to be returned (as VLOOKUP does per standard, using FALSE).
This I can do.

In cell A2 however, I would like to return the 2nd value from my range of
data.

In cell A3, the 3rd ....and so on (only up until around the 6th value).

What do I need to add into my A1 formula, for the 2nd value to be returned
in A2? I guessed it may be as easy as FALSE +1, but this does not seem to
work!

Many thanks

Jenny

  #2   Report Post  
Posted to microsoft.public.excel.misc
JMB
 
Posts: n/a
Default VLOOKUP - more than one return required

One way, let's say the column that contains your keys is in L1:L10, the
column with the data you want returned is in M1:M10, and K1 contains the
value you want to look up:

IF(ROW()COUNTIF($L$1:$L$10,$K$1),"",INDEX($M$1:$M $10,SMALL(IF($L$1:$L$10=$K$1,ROW(INDIRECT("1:"&ROW S($L$1:$L$10))),""),ROW())))

The item that will be returned will be dependent on the row in which the
formula is entered (if entered in cell C8, it will return the 8th item). You
could use a cell reference that specifies which item to return instead of
Row(), then you're not locked into having to enter the formula in a specific
row.

"luvthavodka" wrote:

My range of data (table array) has more than one row that meet the VLOOKUP
criteria I have set.

I have a VLOOKUP in eg A1 =VLOOKUP($K$1,Order_Log,6,FALSE). In this I want
the first value to be returned (as VLOOKUP does per standard, using FALSE).
This I can do.

In cell A2 however, I would like to return the 2nd value from my range of
data.

In cell A3, the 3rd ....and so on (only up until around the 6th value).

What do I need to add into my A1 formula, for the 2nd value to be returned
in A2? I guessed it may be as easy as FALSE +1, but this does not seem to
work!

Many thanks

Jenny

  #3   Report Post  
Posted to microsoft.public.excel.misc
luvthavodka
 
Posts: n/a
Default VLOOKUP - more than one return required

Thanks JMB,

Could you give me an example of say, the cell I'm entering this formula into
is C8, but I actually require the 2nd item to be returned?

Many thanks

Jenny

"JMB" wrote:

One way, let's say the column that contains your keys is in L1:L10, the
column with the data you want returned is in M1:M10, and K1 contains the
value you want to look up:

IF(ROW()COUNTIF($L$1:$L$10,$K$1),"",INDEX($M$1:$M $10,SMALL(IF($L$1:$L$10=$K$1,ROW(INDIRECT("1:"&ROW S($L$1:$L$10))),""),ROW())))

The item that will be returned will be dependent on the row in which the
formula is entered (if entered in cell C8, it will return the 8th item). You
could use a cell reference that specifies which item to return instead of
Row(), then you're not locked into having to enter the formula in a specific
row.

"luvthavodka" wrote:

My range of data (table array) has more than one row that meet the VLOOKUP
criteria I have set.

I have a VLOOKUP in eg A1 =VLOOKUP($K$1,Order_Log,6,FALSE). In this I want
the first value to be returned (as VLOOKUP does per standard, using FALSE).
This I can do.

In cell A2 however, I would like to return the 2nd value from my range of
data.

In cell A3, the 3rd ....and so on (only up until around the 6th value).

What do I need to add into my A1 formula, for the 2nd value to be returned
in A2? I guessed it may be as easy as FALSE +1, but this does not seem to
work!

Many thanks

Jenny

  #4   Report Post  
Posted to microsoft.public.excel.misc
JMB
 
Posts: n/a
Default VLOOKUP - more than one return required

Enter 2 in another cell (say B8) and change Row() to B8, so then the formula
becomes:

=IF(B8COUNTIF($L$1:$L$10,$K$1),"",INDEX($M$1:$M$1 0,SMALL(IF($L$1:$L$10=$K$1,ROW(INDIRECT("1:"&ROWS( $L$1:$L$10))),""),B8)))

You could hardcode the 2 into the formula, but it is easier to work with
when using an external cell reference to contain your criteria.

Also, I don't remember if I stated earlier that this is an array formula.
After keying it into the formula bar, you must hit Control+Shift+Enter.


"luvthavodka" wrote:

Thanks JMB,

Could you give me an example of say, the cell I'm entering this formula into
is C8, but I actually require the 2nd item to be returned?

Many thanks

Jenny

"JMB" wrote:

One way, let's say the column that contains your keys is in L1:L10, the
column with the data you want returned is in M1:M10, and K1 contains the
value you want to look up:

IF(ROW()COUNTIF($L$1:$L$10,$K$1),"",INDEX($M$1:$M $10,SMALL(IF($L$1:$L$10=$K$1,ROW(INDIRECT("1:"&ROW S($L$1:$L$10))),""),ROW())))

The item that will be returned will be dependent on the row in which the
formula is entered (if entered in cell C8, it will return the 8th item). You
could use a cell reference that specifies which item to return instead of
Row(), then you're not locked into having to enter the formula in a specific
row.

"luvthavodka" wrote:

My range of data (table array) has more than one row that meet the VLOOKUP
criteria I have set.

I have a VLOOKUP in eg A1 =VLOOKUP($K$1,Order_Log,6,FALSE). In this I want
the first value to be returned (as VLOOKUP does per standard, using FALSE).
This I can do.

In cell A2 however, I would like to return the 2nd value from my range of
data.

In cell A3, the 3rd ....and so on (only up until around the 6th value).

What do I need to add into my A1 formula, for the 2nd value to be returned
in A2? I guessed it may be as easy as FALSE +1, but this does not seem to
work!

Many thanks

Jenny

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 function return all values j2thea Excel Worksheet Functions 20 November 2nd 05 10:32 PM
Excel 2000 VLOOKUP returns #N/A unless press F2 return on source? Colin Excel Worksheet Functions 3 August 31st 05 01:10 PM
Using a Vlookup to return values in a data list? rtjeter Excel Worksheet Functions 2 April 26th 05 05:56 AM
Want VLookup to Return the row above JoOwl0 Excel Worksheet Functions 8 April 23rd 05 07:16 PM
Vlookup of an if statement return James Excel Worksheet Functions 2 April 6th 05 10:28 PM


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