Lookup values and out horizontally

Steve1977

New Member
Joined
May 16, 2019
Messages
33
I've done Array formula's before and got them working, but for whatever reason, it's not working on my current information.
Currently I've two sheets:

Master Sheet - 'Sheet1M'
2nd Sheet - 'Sheet2S'


Sheet1M contains the following:

60521235

<tbody>
</tbody>
PART01
60521236

<tbody>
</tbody>
PART02
60521237

<tbody>
</tbody>
PART03
542184

<tbody>
</tbody>
PART04
542920

<tbody>
</tbody>
PART05
545069

<tbody>
</tbody>
PART06
60556032

<tbody>
</tbody>
PART07

<tbody>
</tbody>


Sheet2S contains the following:

60521235REF1
60521236REF2
60521236REF3
542184REF4
542920REF5
542920REF6
60556032REF7

<tbody>
</tbody>


So notice how the second sheet has instances where the number in Column A is duplicated because there's more than one ref in Column B

60521235PART01REF1
60521236PART02REF2REF3
60521237PART03
542184PART04REF4
542920PART05REF5REF6
545069

<tbody>
</tbody>
PART06
60556032PART07REF7

<tbody>
</tbody>


When I've done similar things previously this is the Array Formula I have used:
{=INDEX(Sheet2S!$A$2:$B$155508,SMALL(IF(Sheet2S!$A$2:$A$155508=Sheet1M!$A2,ROW(Sheet2S!$A$2:$A$155508)-1),COLUMNS(Sheet1M!$C2)),2)}

But for whatever reason it's simply not working now and I don't know why.

If anyone can help me where I'm going wrong or even seek a resolution via VBA code it would be very much appreciated!
 
Last edited:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,332
Office Version
365
Platform
Windows
The last part of the formula should be
COLUMNS($A$1:A$1)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,332
Office Version
365
Platform
Windows
Or you could use a non-array formula
=IFERROR(INDEX(Sheet2S!$B$2:$B$8,AGGREGATE(15,6,(ROW(Sheet2S!$B$2:$B$8)-ROW(Sheet2S!$B$2)+1)/(Sheet2S!$A$2:$A$8=$A2),COLUMNS($A$1:A$1))),"")
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,332
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

Forum statistics

Threads
1,082,359
Messages
5,364,916
Members
400,815
Latest member
Joaquin Phoenix

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top