메인 컨텐츠로 가기

Excel에서 여러 해당 값을 vlookup하고 연결하는 방법은 무엇입니까?

우리 모두 알고 있듯이 Vlookup Excel의 함수는 값을 조회하고 다른 열의 해당 데이터를 반환하는 데 도움이 될 수 있지만 일반적으로 일치하는 데이터가 여러 개인 경우 첫 번째 상대 값만 가져올 수 있습니다. 이 기사에서는 하나의 셀 또는 세로 목록에서 여러 해당 값을 vlookup하고 연결하는 방법에 대해 설명합니다.

Vlookup 및 수식을 사용하여 세로로 일치하는 여러 값 반환

사용자 정의 함수를 사용하여 셀에서 Vlookup 및 여러 일치 값 연결

Excel 용 Kutools를 사용하여 셀에서 Vlookup 및 여러 일치 값 연결


다음과 같은 데이터 범위가 있다고 가정하면 다음 스크린 샷과 같이 특정 값을 기준으로 모든 해당 값을 수직으로 가져 오려면 배열 수식을 적용 할 수 있습니다.

문서 vlookup 연결 1

1. 다음 공식을 입력하십시오. =IF(COUNTIF($A$1:$A$16,$D$2)>=ROWS($1:1),INDEX($B$1:$B$16,SMALL(IF($A$1:$A$16=$D$2,ROW($1:$16)),ROW(1:1))),"") 결과를 입력 할 빈 셀 (예 : E2)에 입력 한 다음 Ctrl + Shift + Enter 키를 함께 사용하여 특정 기준에 대한 상대 값 기반을 얻으려면 스크린 샷을 참조하십시오.

문서 vlookup 연결 2

주의 사항: 위 공식에서 :

A1 : A16 찾으려는 특정 값을 포함하는 열 범위입니다.

D2 조회하려는 특정 값을 나타냅니다.

B1 : B16 해당 데이터를 반환 할 열 범위입니다.

$ 1 : $ 16 범위 내에서 행 참조를 나타냅니다.

2. 그런 다음 E2 셀을 선택하고 빈 셀이 표시 될 때까지 채우기 핸들을 아래로 드래그하면 다음 스크린 샷과 같이 일치하는 모든 값이 열에 나열됩니다.

문서 vlookup 연결 3


상대 값을 수직으로 가져 오는 대신 때로는 일치하는 값을 하나의 셀에 넣고 특정 구분 기호로 연결하려고합니다. 이 경우 다음 사용자 정의 함수가 도움이 될 수 있습니다.

1. 누르고있어. ALT + F11 키를 눌러 응용 프로그램 용 Microsoft Visual Basic 창.

2. 딸깍 하는 소리 끼워 넣다 > 모듈을 클릭하고 다음 코드를 모듈 창문.

VBA 코드 : Vlookup 및 셀에서 일치하는 여러 값 연결

Function CusVlookup(lookupval, lookuprange As Range, indexcol As Long)
'updateby Extendoffice
Dim x As Range
Dim result As String
result = ""
For Each x In lookuprange
    If x = lookupval Then
        result = result & " " & x.Offset(0, indexcol - 1)
    End If
Next x
CusVlookup = result
End Function

3. 그런 다음이 코드를 저장하고 닫은 다음 워크 시트로 돌아가 다음 공식을 입력합니다. = cusvlookup (D2, A1 : B16,2) 결과를 입력하려는 빈 셀에 넣고 엔터 버튼 키, 특정 데이터를 기반으로하는 모든 해당 값이 공백 구분 기호가있는 하나의 셀로 반환되었습니다. 스크린 샷 참조 :

문서 vlookup 연결 4

주의 사항: 위 공식에서 : D2 조회하려는 셀 값을 나타냅니다. A1 : B16 데이터를 가져올 데이터 범위, 숫자 2 일치하는 값이 반환되는 열 번호입니다. 필요에 따라 이러한 참조를 변경할 수 있습니다.


당신이 있으면 Excel 용 Kutools그와 고급 결합 행 이 작업을 쉽고 빠르게 완료 할 수 있습니다. 이 기능을 사용하면 일치하는 모든 값을 다른 열의 동일한 데이터를 기반으로 특정 구분 기호와 결합 할 수 있습니다.

Excel 용 Kutools : 300 개 이상의 편리한 Excel 추가 기능으로 30 일 동안 제한없이 무료로 사용해 볼 수 있습니다..

설치 후 Excel 용 Kutools, 다음과 같이하십시오.

1. 특정 데이터를 기반으로 해당 값을 가져올 데이터 범위를 선택하십시오.

2. 그런 다음 쿠툴 > 병합 및 분할 > 고급 결합 행, 스크린 샷 참조 :

3. 에서 고급 결합 행 대화 상자에서 결합 할 기준이되는 열 이름을 클릭 한 다음 기본 키 버튼, 스크린 샷 참조 :

문서 vlookup 연결 6

4. 그런 다음 일치하는 값을 반환 할 다른 열 이름을 클릭하고 결합 결합 된 값을 구분하기 위해 하나의 구분 기호를 선택하려면 스크린 샷을 참조하십시오.

문서 vlookup 연결 7

5. 그런 다음 Ok 버튼을 클릭하면 동일한 값을 기반으로하는 모든 해당 값이 특정 구분 기호로 결합되었습니다. 스크린 샷을 참조하십시오.

문서 vlookup 연결 8 2 문서 vlookup 연결 9

 Excel 용 Kutools를 지금 다운로드하고 무료로 평가하십시오!


Excel 용 Kutools: 300 개 이상의 편리한 Excel 추가 기능으로 30 일 동안 제한없이 무료로 사용해 볼 수 있습니다. 지금 다운로드 및 무료 평가판!

최고의 사무 생산성 도구

🤖 Kutools AI 보좌관: 다음을 기반으로 데이터 분석을 혁신합니다. 지능형 실행   |  코드 생성  |  사용자 정의 수식 만들기  |  데이터 분석 및 차트 생성  |  Kutools 기능 호출...
인기 기능: 중복 항목 찾기, 강조 표시 또는 식별   |  빈 행 삭제   |  데이터 손실 없이 열이나 셀 결합   |   수식없이 반올림 ...
슈퍼 조회: 다중 기준 VLookup    다중 값 VLookup  |   여러 시트에 걸친 VLookup   |   퍼지 조회 ....
고급 드롭다운 목록: 드롭다운 목록을 빠르게 생성   |  종속 드롭다운 목록   |  다중 선택 드롭 다운 목록 ....
열 관리자: 특정 개수의 열 추가  |  열 이동  |  Toggle 숨겨진 열의 가시성 상태  |  범위 및 열 비교 ...
특색 지어진 특징: 그리드 포커스   |  디자인보기   |   큰 수식 바    통합 문서 및 시트 관리자   |  리소스 라이브러리 (자동 텍스트)   |  날짜 선택기   |  워크 시트 결합   |  셀 암호화/해독    목록으로 이메일 보내기   |  슈퍼 필터   |   특수 필터 (굵게/기울임꼴/취소선 필터링...) ...
상위 15개 도구 세트12 본문 도구 (텍스트 추가, 문자 제거,...)   |   50+ 거래차트 유형 (Gantt 차트,...)   |   40+ 실용 방식 (생일을 기준으로 나이 계산,...)   |   19 삽입 도구 (QR 코드 삽입, 경로에서 그림 삽입,...)   |   12 매출 상승 도구 (숫자를 단어로, 환율,...)   |   7 병합 및 분할 도구 (고급 결합 행, 셀 분할,...)   |   ... 그리고 더

Excel용 Kutools로 Excel 기술을 강화하고 이전과는 전혀 다른 효율성을 경험해 보세요. Excel용 Kutools는 생산성을 높이고 시간을 절약하기 위해 300개 이상의 고급 기능을 제공합니다.  가장 필요한 기능을 얻으려면 여기를 클릭하십시오...

상품 설명


Office Tab은 Office에 탭 인터페이스를 제공하여 작업을 훨씬 쉽게 만듭니다.

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Is there any way to get the unique "name" for "class1"
This comment was minimized by the moderator on the site
Hello, sym-john,
Maybe the below article can solve your problem, please view it:
https://www.extendoffice.com/documents/excel/3381-excel-extract-unique-values-with-criteria.html
This comment was minimized by the moderator on the site
This is working great for me - is there anyway to change it that it checks if the cell contains rather than a complete match? Basically I have a list of tasks where:
Column A: Dependencies (eg 10003 10004 10008)
Column B: Task Reference (eg 10001)
Column C: Dependent Tasks (the column for the formula result) - where it would lookup the task reference to see which rows contain it in Column A, and then list the Task Reference of those tasks.

E.g:

Row | Column A | Column B | Column C
1 | | 10001 | 10002 10003
2 | 10001 | 10002 | 10003
3 | 10001 10002 | 10003 |
This comment was minimized by the moderator on the site
you would want to use the Instr() function which will check for something in a string of text in a cell. You can also use Left() and Right() if you are looking for the starting or ending details.
This comment was minimized by the moderator on the site
The cusVlookup worked great for me. Another way to have a different separator is to wrap in two substitute functions. The first (from inside to out) replaces the first space with no space, the second replaces all other spaces with a " / " in mine. Could use "," if you want commas.
=SUBSTITUTE(SUBSTITUTE(cusVlookup(D2,Table1,2)," ","",1)," "," / ")

Also, if your lookup value isn't the first column, you can use 0 or negative numbers to go to column to the left.
=SUBSTITUTE(SUBSTITUTE(cusVlookup(D2,Table1,-1)," ","",1)," "," / ")
This comment was minimized by the moderator on the site
Hi, jeff,
Thanks for your sharing, you must be a warmhearted man.
This comment was minimized by the moderator on the site
I have to say, I have been trying to get a formula for combining multiple values and returning them to a single cell for 2 days now. This "How To" has saved me!! Thank you SO much! I would never have gotten it without your Module!
I do have 2 questions though. I have the deliminator as a comma instead of a space and because of that it starts out with a comma. Is there a way to prevent the start comma but keep the rest?
My second question is; When I use the fill handle it changes the range values as well as the cell value I want to look up. I want it to continue to change the cell number I want to look up but keep the same range values. How can I make this happen?

Thank you so much for your help!!
This comment was minimized by the moderator on the site
Is there a way to delete the duplicate values in the concatenate?
This comment was minimized by the moderator on the site
Hello, Jacob,
May be the following article can help you to solve your problem.
https://www.extendoffice.com/documents/excel/3381-excel-extract-unique-values-with-criteria.html

Please try, hope it can help you!
This comment was minimized by the moderator on the site
Is there a way to list the duplicate values only once, using the vba code and formula above? I am not sure where to put the countif>1 statement in the formula bar, or in the vba itself. Please help
This comment was minimized by the moderator on the site
you can add two extra condition to skip blank cells and to skip duplicates:For i = 1 To CriteriaRange.Count
If CriteriaRange.Cells(i).Value = Condition Then
If ConcatenateRange.Cells(i).Value <> "" Then 'SKIP BANKS
If InStr(xResult, ConcatenateRange.Cells(i).Value) = 0 Then 'SKIP IF FOUND DUPLICATE
xResult = xResult & Separator & ConcatenateRange.Cells(i).Value
End If
End If
End If
Next i
This comment was minimized by the moderator on the site
This is amazing but i am looking for something else, i have a table with RollNo StudentName sub1, sub2, sub3 ... Total Result, When I enter Rollnumber it should give a result like "SName Sub1 64, sub2 78,... Total 389, Result pass", is it possible
This comment was minimized by the moderator on the site
Loved the function for Excel 2013 but amended it slightly to change the separating character to ";" instead of " " and then remove the prefixed ";" from the concantenated values Results matching values in my example would have ;result01 or ;result01;result02 . Added the extra If Left(xResult, 1) = ";" to remove any extra ";" at the beginning of the string if it is the 1st character. I'm sure there is a neater way of doing it but it worked for me. :) Function CusVlookup(pValue As String, pWorkRng As Range, pIndex As Long) Dim rng As Range Dim xResult As String xResult = "" For Each rng In pWorkRng If rng = pValue Then xResult = xResult & ";" & rng.Offset(0, pIndex - 1) If Left(xResult, 1) = ";" Then xResult = MID(xResult,2,255) End If End If Next CusVlookup = xResult End Function
This comment was minimized by the moderator on the site
Make if condition for result if empty.

Function CusVlookup(lookupval, lookuprange As Range, indexcol As Long)
'updateby Extendoffice 20151118
Dim x As Range
Dim result As String
result = ""
For Each x In lookuprange
If x = lookupval Then
If Not result = "" Then
result = result & " " & x.Offset(0, indexcol - 1)
Else
result = x.Offset(0, indexcol - 1)
End If
Next x
CusVlookup = result
End Function
This comment was minimized by the moderator on the site
When using the cusvlookup is there a way to add the last name as well with a comma in between that might appear in Column C
This comment was minimized by the moderator on the site
How to get the result. Please help. data data1 result a 1 a1 b 2 a2 c b1 b2 c1 c2
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations