Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default vlookup for the second value of a list

Hi,

I essentially want to perform a vlookup of the second (not top) lookup value
in an array. So if I have the following data set:

1 A 100
2 B 78
3 A 63
4 C 52
5 C 49
6 B 24


....I want to turn it into this on another page:

A 100
A 63
B 78
B 24
C 52
C 49


Getting the top A to return 100 is easy--it's just a pure vlookup. But
getting it to retun the second-ranked A is harder since vlookup just looks to
the #1 A and brings 100 again. Does anyone have any thoughts or suggestions
for a formula (or formulas)?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default vlookup for the second value of a list

Why wouldn't you just sort the data? That seems to be what you are doing.


"alext49" wrote in message
...
Hi,

I essentially want to perform a vlookup of the second (not top) lookup
value
in an array. So if I have the following data set:

1 A 100
2 B 78
3 A 63
4 C 52
5 C 49
6 B 24


...I want to turn it into this on another page:

A 100
A 63
B 78
B 24
C 52
C 49


Getting the top A to return 100 is easy--it's just a pure vlookup. But
getting it to retun the second-ranked A is harder since vlookup just looks
to
the #1 A and brings 100 again. Does anyone have any thoughts or
suggestions
for a formula (or formulas)?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default vlookup for the second value of a list

Are there *always* no more than 2 of each value?

Biff

"alext49" wrote in message
...
Hi,

I essentially want to perform a vlookup of the second (not top) lookup
value
in an array. So if I have the following data set:

1 A 100
2 B 78
3 A 63
4 C 52
5 C 49
6 B 24


...I want to turn it into this on another page:

A 100
A 63
B 78
B 24
C 52
C 49


Getting the top A to return 100 is easy--it's just a pure vlookup. But
getting it to retun the second-ranked A is harder since vlookup just looks
to
the #1 A and brings 100 again. Does anyone have any thoughts or
suggestions
for a formula (or formulas)?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default vlookup for the second value of a list

Maybe I didn't quite explain it enough...sorting doesn't work for what I'm
trying to do. I'm using Data Validation to pull only the A's (layed out on
the page in a certain way), only the B's. And it's not simply one column
which needs to be sorted. Instead, it's A--Z (about 30 data sets) and 22
different groupings which need to be laid out on a page based on whichever
data set is being validated (A--Z). It's complicated.

Anyways, is there a lookup for the second largest value?

"PCLIVE" wrote:

Why wouldn't you just sort the data? That seems to be what you are doing.


"alext49" wrote in message
...
Hi,

I essentially want to perform a vlookup of the second (not top) lookup
value
in an array. So if I have the following data set:

1 A 100
2 B 78
3 A 63
4 C 52
5 C 49
6 B 24


...I want to turn it into this on another page:

A 100
A 63
B 78
B 24
C 52
C 49


Getting the top A to return 100 is easy--it's just a pure vlookup. But
getting it to retun the second-ranked A is harder since vlookup just looks
to
the #1 A and brings 100 again. Does anyone have any thoughts or
suggestions
for a formula (or formulas)?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default vlookup for the second value of a list

Correct...there are never more than 2.

Thanks in advance...





"T. Valko" wrote:

Are there *always* no more than 2 of each value?

Biff

"alext49" wrote in message
...
Hi,

I essentially want to perform a vlookup of the second (not top) lookup
value
in an array. So if I have the following data set:

1 A 100
2 B 78
3 A 63
4 C 52
5 C 49
6 B 24


...I want to turn it into this on another page:

A 100
A 63
B 78
B 24
C 52
C 49


Getting the top A to return 100 is easy--it's just a pure vlookup. But
getting it to retun the second-ranked A is harder since vlookup just looks
to
the #1 A and brings 100 again. Does anyone have any thoughts or
suggestions
for a formula (or formulas)?






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default vlookup for the second value of a list

Ok...

With this data in the range A1:B6

A 100
B 78
A 63
C 52
C 49
B 24

This data in the range F1:F6

A
A
B
B
C
C

Enter this formula in G1:

=VLOOKUP(F1,A1:B6,2,0)

Enter this formula in G2 and copy down to G6:

=IF(F2=F1,LOOKUP(2,1/(A$1:A$6=F2),B$1:B$6),VLOOKUP(F2,A$1:B$6,2,0))

Biff

"alext49" wrote in message
...
Correct...there are never more than 2.

Thanks in advance...





"T. Valko" wrote:

Are there *always* no more than 2 of each value?

Biff

"alext49" wrote in message
...
Hi,

I essentially want to perform a vlookup of the second (not top) lookup
value
in an array. So if I have the following data set:

1 A 100
2 B 78
3 A 63
4 C 52
5 C 49
6 B 24


...I want to turn it into this on another page:

A 100
A 63
B 78
B 24
C 52
C 49


Getting the top A to return 100 is easy--it's just a pure vlookup. But
getting it to retun the second-ranked A is harder since vlookup just
looks
to
the #1 A and brings 100 again. Does anyone have any thoughts or
suggestions
for a formula (or formulas)?






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 740
Default vlookup for the second value of a list

alext49,

did u mean the list may contain something like this,,,,no more than 2
"value" on first and second column.

D 100
D 100
F 100
F 100
E 100
E 100

or u mean like this...no more than 1 "value" on second column

D 100
D 50
F 100
F 50
E 100
E 50

regards,
driller

--
*****
birds of the same feather flock together..



"alext49" wrote:

Correct...there are never more than 2.

Thanks in advance...





"T. Valko" wrote:

Are there *always* no more than 2 of each value?

Biff

"alext49" wrote in message
...
Hi,

I essentially want to perform a vlookup of the second (not top) lookup
value
in an array. So if I have the following data set:

1 A 100
2 B 78
3 A 63
4 C 52
5 C 49
6 B 24


...I want to turn it into this on another page:

A 100
A 63
B 78
B 24
C 52
C 49


Getting the top A to return 100 is easy--it's just a pure vlookup. But
getting it to retun the second-ranked A is harder since vlookup just looks
to
the #1 A and brings 100 again. Does anyone have any thoughts or
suggestions
for a formula (or formulas)?




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default vlookup for the second value of a list

Or to do it in a single formula use:-

=INDEX(A1:B7,SMALL(IF(A1:B7="a",ROW(A1:B7)-ROW(A1)+1,ROW(B7)+1),2),2)

The second to last 2 can be changed to make it find the Nth occurence.

It's an array so Ctrl+Shift+enter.

Mike

"alext49" wrote:

Hi,

I essentially want to perform a vlookup of the second (not top) lookup value
in an array. So if I have the following data set:

1 A 100
2 B 78
3 A 63
4 C 52
5 C 49
6 B 24


...I want to turn it into this on another page:

A 100
A 63
B 78
B 24
C 52
C 49


Getting the top A to return 100 is easy--it's just a pure vlookup. But
getting it to retun the second-ranked A is harder since vlookup just looks to
the #1 A and brings 100 again. Does anyone have any thoughts or suggestions
for a formula (or formulas)?

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default vlookup for the second value of a list

This works...you rock. Thanks for the help!!!

"T. Valko" wrote:

Ok...

With this data in the range A1:B6

A 100
B 78
A 63
C 52
C 49
B 24

This data in the range F1:F6

A
A
B
B
C
C

Enter this formula in G1:

=VLOOKUP(F1,A1:B6,2,0)

Enter this formula in G2 and copy down to G6:

=IF(F2=F1,LOOKUP(2,1/(A$1:A$6=F2),B$1:B$6),VLOOKUP(F2,A$1:B$6,2,0))

Biff

"alext49" wrote in message
...
Correct...there are never more than 2.

Thanks in advance...





"T. Valko" wrote:

Are there *always* no more than 2 of each value?

Biff

"alext49" wrote in message
...
Hi,

I essentially want to perform a vlookup of the second (not top) lookup
value
in an array. So if I have the following data set:

1 A 100
2 B 78
3 A 63
4 C 52
5 C 49
6 B 24


...I want to turn it into this on another page:

A 100
A 63
B 78
B 24
C 52
C 49


Getting the top A to return 100 is easy--it's just a pure vlookup. But
getting it to retun the second-ranked A is harder since vlookup just
looks
to
the #1 A and brings 100 again. Does anyone have any thoughts or
suggestions
for a formula (or formulas)?







  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default vlookup for the second value of a list

You're welcome. Thanks for the feedback!

Biff

"alext49" wrote in message
...
This works...you rock. Thanks for the help!!!

"T. Valko" wrote:

Ok...

With this data in the range A1:B6

A 100
B 78
A 63
C 52
C 49
B 24

This data in the range F1:F6

A
A
B
B
C
C

Enter this formula in G1:

=VLOOKUP(F1,A1:B6,2,0)

Enter this formula in G2 and copy down to G6:

=IF(F2=F1,LOOKUP(2,1/(A$1:A$6=F2),B$1:B$6),VLOOKUP(F2,A$1:B$6,2,0))

Biff

"alext49" wrote in message
...
Correct...there are never more than 2.

Thanks in advance...





"T. Valko" wrote:

Are there *always* no more than 2 of each value?

Biff

"alext49" wrote in message
...
Hi,

I essentially want to perform a vlookup of the second (not top)
lookup
value
in an array. So if I have the following data set:

1 A 100
2 B 78
3 A 63
4 C 52
5 C 49
6 B 24


...I want to turn it into this on another page:

A 100
A 63
B 78
B 24
C 52
C 49


Getting the top A to return 100 is easy--it's just a pure vlookup.
But
getting it to retun the second-ranked A is harder since vlookup just
looks
to
the #1 A and brings 100 again. Does anyone have any thoughts or
suggestions
for a formula (or formulas)?









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 - splitting the list Daniel Excel Discussion (Misc queries) 4 April 21st 07 07:04 PM
Filter the results of a list based on a previous vlookup against the same list Mizpah Excel Worksheet Functions 2 August 18th 06 10:28 AM
Can I add a drop-down list to a Vlookup? dsharb52 Excel Worksheet Functions 1 July 11th 06 11:28 PM
vlookup returns list? tjb Excel Worksheet Functions 5 December 6th 05 11:49 PM
An unsorted list in vlookup Traima Excel Worksheet Functions 2 August 8th 05 01:10 PM


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