Lookup With No Duplicates

excelbytes

Active Member
Joined
Dec 11, 2014
Messages
291
Office Version
  1. 365
Platform
  1. Windows
Can you help me with a formula in column B? I know I've done this a few times before but for the life of me (getting old), can't remember how I did it. The lookup value is in column A. I need to look that value up in column D and return the result from column E. There are obviously duplicates and I need the formula to not duplicate any results.


Screenshot 2024-04-07 134431.png
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
How about this?

Excel
ABCDEFG
1LookupOutputFormula
2208Sample 1Sample 1208Sample 1
3208Sample 2Sample 2208Sample 2
4208Sample 3Sample 3208Sample 3
5208Sample 4Sample 4208Sample 4
6208Sample 5Sample 5208Sample 5
7209Sample 11Sample 11208Sample 6
8209Sample 12Sample 12208Sample 7
9209Sample 13Sample 13208Sample 8
10209Sample 14Sample 14208Sample 9
11209Sample 15Sample 15208Sample 10
12209Sample 16Sample 16209Sample 11
13209Sample 17Sample 17209Sample 12
14213Sample 25Sample 25209Sample 13
15213Sample 26Sample 26209Sample 14
16213Sample 27Sample 27209Sample 15
17209Sample 16
18209Sample 17
19209Sample 18
20209Sample 19
21209Sample 20
22209Sample 21
23209Sample 22
24209Sample 23
25209Sample 24
26213Sample 25
27213Sample 26
28213Sample 27
29213Sample 28
30213Sample 29
31213Sample 30
32217Sample 31
33217Sample 32
34218Sample 33
Sheet5
Cell Formulas
RangeFormula
G2:G34G2="Sample " & SEQUENCE(33)
C2:C16C2=INDEX($G$2#,COUNTIF($A$2:A2,A2)+XMATCH(A2,$F$2:$F$34)-1)
Dynamic array formulas.
 
Upvote 0
How about this?
I suspect that column G may well not be a spilled array, so perhaps this modification.
Excel Formula:
=INDEX(G$2:G$34,COUNTIF(A$2:A2,A2)+XMATCH(A2,F$2:F$34)-1)

@excelbytes
If column E is always grouped like your sample then one of the above formulas should be fine (adjusting to your columns)
I have included another option below, in case column E may not always be grouped.

24 04 08.xlsm
ABCDEF
1LookupFormula
2208Sample 4209Sample 1
3208Sample 7217Sample 2
4208Sample 9209Sample 3
5208Sample 10208Sample 4
6208Sample 16209Sample 5
7209Sample 1209Sample 6
8209Sample 3208Sample 7
9209Sample 5213Sample 8
10209Sample 6208Sample 9
11209Sample 11208Sample 10
12209Sample 14209Sample 11
13209Sample 15218Sample 12
14213Sample 8213Sample 13
15213Sample 13209Sample 14
16213Sample 25209Sample 15
17208Sample 16
18209Sample 17
19209Sample 18
20208Sample 19
21209Sample 20
22217Sample 21
23208Sample 22
24208Sample 23
25208Sample 24
26213Sample 25
27213Sample 26
28213Sample 27
29208Sample 28
30209Sample 29
31209Sample 30
32209Sample 31
33209Sample 32
34213Sample 33
Lookup (2)
Cell Formulas
RangeFormula
B2:B16B2=INDEX(F:F,AGGREGATE(15,6,ROW(E$2:E$34)/(E$2:E$34=A2),COUNTIF(A$2:A2,A2)))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,270
Messages
6,171,103
Members
452,379
Latest member
IainTru

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