Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
bill9340
 
Posts: n/a
Default Vlookup based on designated occurrence of value


Easier to show than explain, assume first column has colors & second has
letters:


Red A
Blue B
Red C
Yellow D
Red E
Blue F

What set of functions can I put in a cell so that it will look for,
let's say, the third row that Red occurs in, then return the value E
from the adjacent column.

Thank you in advance
Bill


--
bill9340
------------------------------------------------------------------------
bill9340's Profile: http://www.excelforum.com/member.php...o&userid=28516
View this thread: http://www.excelforum.com/showthread...hreadid=481724

  #2   Report Post  
Ron Coderre
 
Posts: n/a
Default Vlookup based on designated occurrence of value


Using your data in cells A1:B6 . . .
D1: Red
D2: 3

D3:
=INDEX($B$1:$B$6,MATCH($D$2,--COUNTIF(INDIRECT("$A$1:$A$"&ROW(1:6)),$D$1),0))

Note: Commit that array formula by holding down the [Ctrl] and [Shift]
keys when you press [Enter].

That function will return the Col B value that corresponds to the 3rd
occurrence of 'Red' in Col A.

Does that help?

•••••••••••
Regards,
Ron


--
Ron Coderre
------------------------------------------------------------------------
Ron Coderre's Profile: http://www.excelforum.com/member.php...o&userid=21419
View this thread: http://www.excelforum.com/showthread...hreadid=481724

  #3   Report Post  
bill9340
 
Posts: n/a
Default Vlookup based on designated occurrence of value


That is way above my level, I would have never figured it out. It
worked like a charm, thanks!


--
bill9340
------------------------------------------------------------------------
bill9340's Profile: http://www.excelforum.com/member.php...o&userid=28516
View this thread: http://www.excelforum.com/showthread...hreadid=481724

  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default Vlookup based on designated occurrence of value

Ron Coderre wrote...
Using your data in cells A1:B6 . . .
D1: Red
D2: 3

D3:
=INDEX($B$1:$B$6,MATCH($D$2,--COUNTIF(INDIRECT("$A$1:$A$"&ROW(1:6)),$D$1),0))

....

You could use a shorter formula that avoids volatile function calls.

=INDEX($B:$B,SMALL(IF($A$1:$A$6=$D$1,ROW($A$1:$A$6 )),$D$2))

Also an array formula.

  #5   Report Post  
Harlan Grove
 
Posts: n/a
Default Vlookup based on designated occurrence of value

Ron Coderre wrote...
Using your data in cells A1:B6 . . .
D1: Red
D2: 3

D3:
=INDEX($B$1:$B$6,MATCH($D$2,--COUNTIF(INDIRECT("$A$1:$A$"&ROW(1:6)),$D$1),0))

....

You could use a shorter formula that avoids volatile function calls.

=INDEX($B:$B,SMALL(IF($A$1:$A$6=$D$1,ROW($A$1:$A$6 )),$D$2))

Also an array formula.

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
sumif based on vlookup array Brian Winkler Excel Worksheet Functions 6 October 16th 05 02:52 PM
format cell based on results of vlookup function Edith F Excel Worksheet Functions 1 July 21st 05 08:39 PM
Vlookup based on two lookup values Trip Excel Worksheet Functions 2 April 8th 05 07:25 PM
vlookup data hidden within worksheet Excel Worksheet Functions 0 January 26th 05 01:09 PM
Can VLOOKUP return multiple answers based on several identical lo. jddtct Excel Worksheet Functions 3 January 11th 05 08:03 AM


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