Vlookup for a cell with multiple criteria

AdrianCepa

New Member
Joined
May 19, 2014
Messages
27
I have a spreadsheet which looks like this
[TABLE="width: 407"]
<tbody>[TR]
[TD]in the second spreadsheet (Sheet2) i have a list of names with associated references to them. what id like is these refferences to appear in collumn P seperated by a comma like the names are in collumn O, is this possible?
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]O
[/TD]
[TD="align: center"]P
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]General Access
[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: center"]General Access
[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"]
[TABLE="width: 407"]
<tbody>[TR]
[TD]Registry Administration, Kumar Ramu, Ubaidillah A Hasan, Amran Jamaluddin, Norizah Hamzah, Amelia Rosdiana Othman, Anne Ong, Salwiyah Jumaah, Noorashikin A Mohd Ali, Nor Hafiza Abizaid
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD="align: center"]General Access
[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD]
[TABLE="width: 407"]
<tbody>[TR]
[TD]Registry - Administration, Daryl K Wood, Kumar Ramu, Anne Ong
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Upvote 0
This will hopefully work,

this is a table from "sheet1" in my work book, it has some restriction groups and some names, The table Underneath is from sheet 2 and shows the Refference for these people, is it possible for a formula in excel to pick out the names in cells from table in Sheet 1 and lookup the refferences for these people in the table from sheet 2? (all the data is in the first two collumns of both the spreadsheets)

if this table doesnt make sense, i have inserted another file into the one drive which should work now, otherwise i have no clue how to show you sorry :(

[TABLE="class: grid, width: 305"]
<tbody>[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Registry Administration, John Smith, Alan White, Graham Willis, Andy Grey[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]General Access[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Registry Administration, John Smith, Alan White, Graham Willis, Andy Grey[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Registry Administration, John Smith, Alan White, Graham Willis, Andy Grey[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Registry Administration, John Smith, Alan White, Graham Willis, Andy Grey[/TD]
[TD] [/TD]
[/TR]
</tbody><colgroup><col><col></colgroup>[/TABLE]
[TABLE="class: grid, width: 252"]
<tbody>[TR]
[TD]John Smith[/TD]
[TD]H12345678[/TD]
[/TR]
[TR]
[TD]Alan White[/TD]
[TD]H12345677[/TD]
[/TR]
[TR]
[TD]Graham Willis[/TD]
[TD]H12345666[/TD]
[/TR]
[TR]
[TD]Andy Grey[/TD]
[TD]H12345555[/TD]
[/TR]
</tbody><colgroup><col><col></colgroup>[/TABLE]
 
Upvote 0
"H12345678, H12345677, H12345666, H12345555" if thats possible

B1, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(LEFT($A1,LEN("Registry Administration"))="Registry Administration",
  REPLACE(aconcat(IF(ISNUMBER(SEARCH(","&SUBSTITUTE(Sheet2!$B$1:$B$4," ","")&",",
  ","&SUBSTITUTE(A1," ","")&",")),", "&Sheet2!$C$1:$C$4,"")),1,2,""),"")

ACONCAT is a function coded in <ACRONYM title="visual basic for applications">VBA</ACRONYM>, which is given below. You need to add this to your workbook using Alt+F11 in order to run the foregoing formula.

Function aconcat(a As Variant, Optional sep As String = "") As String
' Harlan Grove, Mar 2002
Dim y As Variant
If TypeOf a Is Range Then
For Each y In a.Cells
aconcat = aconcat & y.Value & sep
Next y
ElseIf IsArray(a) Then
For Each y In a
aconcat = aconcat & y & sep
Next y
Else
aconcat = aconcat & a & sep
End If
aconcat = Left(aconcat, Len(aconcat) - Len(sep))
End Function

See the workbook that embodies the foregoing set up:
https://dl.dropboxusercontent.com/u/65698317/AdrianCepa%20test.xlsm
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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