ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Formula - Capture Multiple names into One cell (https://www.excelbanter.com/new-users-excel/201881-formula-capture-multiple-names-into-one-cell.html)

PSU35

Formula - Capture Multiple names into One cell
 
I hope I can explain this clearly.

I need advise on how to write a formula that will:
1) look thru a string of cells in a column for a match to a number
specified in another cell
2)then return the person name located in the cell next to the match

Sounds simple except ther will be multiple matches to the number and each
match can have a different name. I need to show all the names that match,
seperated by a comma, in this one cell.

Chip Pearson

Formula - Capture Multiple names into One cell
 
The VLOOKUP function should do this. If the value to be matched is in A1 and
the list of data is in B1:C100, then use

=VLOOKUP(A1,B1:C100,2,FALSE)

That will scan down column B until a value matches A1, go to the next column
and return the data there. If no match is found, the formula will return
#N/A. The FALSE in the formula indicates that VLOOKUP is to match the exact
value in A1.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



"PSU35" wrote in message
...
I hope I can explain this clearly.

I need advise on how to write a formula that will:
1) look thru a string of cells in a column for a match to a number
specified in another cell
2)then return the person name located in the cell next to the match

Sounds simple except ther will be multiple matches to the number and each
match can have a different name. I need to show all the names that match,
seperated by a comma, in this one cell.



PSU35

Formula - Capture Multiple names into One cell
 
Chip
What is the FALSE for? Do I replace that with something ?

"Chip Pearson" wrote:

The VLOOKUP function should do this. If the value to be matched is in A1 and
the list of data is in B1:C100, then use

=VLOOKUP(A1,B1:C100,2,FALSE)

That will scan down column B until a value matches A1, go to the next column
and return the data there. If no match is found, the formula will return
#N/A. The FALSE in the formula indicates that VLOOKUP is to match the exact
value in A1.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



"PSU35" wrote in message
...
I hope I can explain this clearly.

I need advise on how to write a formula that will:
1) look thru a string of cells in a column for a match to a number
specified in another cell
2)then return the person name located in the cell next to the match

Sounds simple except ther will be multiple matches to the number and each
match can have a different name. I need to show all the names that match,
seperated by a comma, in this one cell.



PSU35

Formula - Capture Multiple names into One cell
 
Chip
Tried the formula with "False" and it returns only one name, the first one
it see's. Without "False" it return the last name it see's. It's not giving
me all the names.

"Chip Pearson" wrote:

The VLOOKUP function should do this. If the value to be matched is in A1 and
the list of data is in B1:C100, then use

=VLOOKUP(A1,B1:C100,2,FALSE)

That will scan down column B until a value matches A1, go to the next column
and return the data there. If no match is found, the formula will return
#N/A. The FALSE in the formula indicates that VLOOKUP is to match the exact
value in A1.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



"PSU35" wrote in message
...
I hope I can explain this clearly.

I need advise on how to write a formula that will:
1) look thru a string of cells in a column for a match to a number
specified in another cell
2)then return the person name located in the cell next to the match

Sounds simple except ther will be multiple matches to the number and each
match can have a different name. I need to show all the names that match,
seperated by a comma, in this one cell.



Don Guillett

Formula - Capture Multiple names into One cell
 
Use datafilterautofilter on the number

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"PSU35" wrote in message
...
I hope I can explain this clearly.

I need advise on how to write a formula that will:
1) look thru a string of cells in a column for a match to a number
specified in another cell
2)then return the person name located in the cell next to the match

Sounds simple except ther will be multiple matches to the number and each
match can have a different name. I need to show all the names that match,
seperated by a comma, in this one cell.



Don Guillett

Formula - Capture Multiple names into One cell
 
Oops. You said you want a list of all hits in ONE cell
Sub FiltertoOneCell()
mynum = 1 'put your number here

lr = Cells(Rows.Count, "a").End(xlUp).Row
Range("A1:B" & lr).AutoFilter Field:=1, Criteria1:=mynum
For Each c In Range("b2:b" & lr).SpecialCells(xlCellTypeVisible)
ms = ms & ", " & c
Next c
MsgBox Right(ms, Len(ms) - 1)
Range("c1").Value = Right(ms, Len(ms) - 1)
Range("A1:B" & lr).AutoFilter
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
Use datafilterautofilter on the number

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"PSU35" wrote in message
...
I hope I can explain this clearly.

I need advise on how to write a formula that will:
1) look thru a string of cells in a column for a match to a number
specified in another cell
2)then return the person name located in the cell next to the match

Sounds simple except ther will be multiple matches to the number and each
match can have a different name. I need to show all the names that
match,
seperated by a comma, in this one cell.





All times are GMT +1. The time now is 03:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com