Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default VLookup - Choose Which Occurence of Lookup value to bring back

I have a table where the lookup value appears multiple times .....

ie Table Looks like this

Value Ref
3 A
5 Z
6 B
7 C
3 F
5 G

With standard lookup functionality, If I looked-up value 3, I would bring
back "A"
I'd like a method where I can specify which occurence of "3" in the table it
brings back data from. (ie to be able to do a lookup & specify to bring back
data from the second record of "3" rather than the default first)

Any Ideas ????
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default VLookup - Choose Which Occurence of Lookup value to bring back

You can add an occurence number to the lookup value and then use that to do
the lookup...

To get the occurence no. you can type this formula in any column (say Col B)
row 1 and copy down
=COUNTIF($A$1:A1,A1)
then you can can concatenate A & B in Col C and use that as the lookup col.

VLOOKUP itself does not allow you to pick the occurence no. it returns the
first match.

"CHACHING" wrote:

I have a table where the lookup value appears multiple times .....

ie Table Looks like this

Value Ref
3 A
5 Z
6 B
7 C
3 F
5 G

With standard lookup functionality, If I looked-up value 3, I would bring
back "A"
I'd like a method where I can specify which occurence of "3" in the table it
brings back data from. (ie to be able to do a lookup & specify to bring back
data from the second record of "3" rather than the default first)

Any Ideas ????

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 265
Default VLookup - Choose Which Occurence of Lookup value to bring back

In article ,
CHACHING wrote:

I have a table where the lookup value appears multiple times .....

ie Table Looks like this

Value Ref
3 A
5 Z
6 B
7 C
3 F
5 G

With standard lookup functionality, If I looked-up value 3, I would bring
back "A"
I'd like a method where I can specify which occurence of "3" in the table it
brings back data from. (ie to be able to do a lookup & specify to bring back
data from the second record of "3" rather than the default first)

Any Ideas ????



Assumptions:

A2:B7 contains the data

D2 contains the lookup value

E2 contains the occurrence of interest

Formula:

=INDEX(B2:B7,SMALL(IF(A2:A7=D2,ROW(A2:A7)-ROW(A2)+1),E2))

....confirmed with CONTROL+SHIFT+ENTER.

--
Domenic
http://www.xl-central.com
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
Bring Back DBF! The GIS Industry uses it! Jobhater Excel Discussion (Misc queries) 6 June 9th 10 07:57 PM
lookup to bring back multiple values zakfalls Excel Worksheet Functions 3 May 28th 09 05:36 PM
How do I. VLOOKUP & BRING BACK THE CELL BELOW THE CELL WHICH IS FO Chris Excel Worksheet Functions 2 November 16th 06 02:42 AM
Bring Back Qualified Sum from another WB Excel Worksheet Functions 4 April 8th 05 01:01 AM
Using VLOOKUP,what if I have more than one occurence of my Lookup. Mondie Excel Worksheet Functions 3 January 28th 05 07:45 PM


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