Formula required for 'LOOKUP'

delamere

New Member
Joined
Apr 28, 2005
Messages
9
I would like to find the THIRD occurrence of a value in a sorted list and with a blank if there is none.
VLOOKUP finds the FIRST occurrence.
The sample sheet shows a VLOOLUP attempt with BARNES as the answer; I want PUTNEY to be the result.
Any ideas?
Book2
ABCD
1KEYNAMEADDRESSFormula
2AAAABARNES
3AALONDON
4AAPUTNEY
5=VLOOKUP(A2,B2:C4,2,FALSE)
6BARNES
Sheet1
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
You could try this array formula which must be confirmed with CTRL+SHIFT+ENTER

=INDEX(C2:C4,SMALL(IF(A2=B2:B4,ROW(B2:B4)-ROW(A1)),3))

The three at the end is effectively the occurrence number
 
Upvote 0
Thank you VERY much for your help. Your formula is mind boggling for a novice like me!!
I wanted it to complete a table such as the one below.
I have added to your formula to enable blanks to be shown when values are not found.
This is an example of what I wanted, and now can, achieve.
The formula I finished up with (cell B2) is
'IF(ISERROR(INDEX($E$2:$E$1000,SMALL(IF($A2=$D$2:$D$1000,ROW($D$2:$D$1000)-ROW($A$1)),G2))),"",INDEX($E$2:$E$1000,SMALL(IF($A2=$D$2:$D$1000,ROW($D$2:$D$1000)-ROW($A$1)),G2)))
A bit long but it works!
THANK YOU again.
MREX100505 Sample DrExcel sheet.xls
ABCDEFG
2AAABILLAAABILL1
3JANEAAAJANE2
4FREDAAAFRED3
5 BBBPAUL4
6BBBPAULCCCDAVID1
7 CCCBARRY2
8 CCCGEMMA3
9 CCCJO4
10CCCDAVIDDDDROBERT1
11BARRYDDDLOUISE2
12GEMMA3
13JO4
14DDDROBERT1
15LOUISE2
16 3
17 4
Sheet17
 
Upvote 0

Forum statistics

Threads
1,221,668
Messages
6,161,158
Members
451,687
Latest member
KENNETH ROGERS

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top