메인 컨텐츠로 가기

Excel에서 하나 또는 여러 조건을 기반으로 여러 일치 값을 반환하는 방법은 무엇입니까?

일반적으로 특정 값을 조회하고 일치하는 항목을 반환하는 것은 VLOOKUP 함수를 사용하여 우리 대부분에게 쉽습니다. 그러나 다음 스크린 샷과 같이 하나 이상의 기준에 따라 여러 일치 값을 반환하려고 시도한 적이 있습니까? 이 기사에서는 Excel에서이 복잡한 작업을 해결하기위한 몇 가지 공식을 소개합니다.

배열 수식을 사용하여 하나 또는 여러 조건을 기반으로 여러 일치 값을 반환합니다.


배열 수식을 사용하여 하나 또는 여러 조건을 기반으로 여러 일치 값을 반환합니다.

예를 들어, 28 세이고 미국에서 온 모든 이름을 추출하려면 다음 공식을 적용하십시오.

1. 결과를 찾을 빈 셀에 아래 수식을 복사하거나 입력하십시오.

=INDEX($B$2:$B$11, SMALL(IF(COUNTIF($F$2, $C$2:$C$11)*COUNTIF($G$2, $D$2:$D$11), ROW($A$2:$D$11)-MIN(ROW($A$2:$D$11))+1), ROW(A1)), COLUMN(A1))

주의 사항: 위의 공식에서 B2 : B11 일치하는 값이 반환되는 열입니다. F2, C2 : C11 첫 번째 조건과 첫 번째 조건을 포함하는 열 데이터입니다. G2, D2 : D11 두 번째 조건과이 조건을 포함하는 열 데이터입니다. 필요에 따라 변경하십시오.

2. 그런 다음, Ctrl + Shift + Enter 키를 눌러 첫 번째 일치하는 결과를 얻은 다음 첫 번째 수식 셀을 선택하고 오류 값이 표시 될 때까지 채우기 핸들을 셀 아래로 끕니다. 이제 아래 스크린 샷과 같이 일치하는 모든 값이 반환됩니다.

방문 꿀팁: 하나의 조건에 따라 일치하는 모든 값을 반환해야하는 경우 아래 배열 수식을 적용하십시오.

=IFERROR(INDEX($B$2:$B$11, SMALL(IF($F$2=$D$2:$D$11, ROW($D$2:$D$11)-ROW($D$2)+1), ROW(1:1))),"" )


더 많은 관련 기사 :

  • 하나의 쉼표로 구분 된 셀에 여러 조회 값 반환
  • Excel에서 VLOOKUP 함수를 적용하여 테이블 셀에서 첫 번째로 일치하는 값을 반환 할 수 있지만 때로는 일치하는 모든 값을 추출한 다음 쉼표, 대시 등과 같은 특정 구분 기호로 분리해야합니다. 다음 스크린 샷과 같이 셀. Excel에서 쉼표로 구분 된 하나의 셀에서 여러 조회 값을 가져오고 반환하려면 어떻게해야합니까?
  • Vlookup 및 Google 시트에서 한 번에 여러 일치 값 반환
  • Google 시트의 일반 Vlookup 함수는 주어진 데이터를 기반으로 첫 번째 일치 값을 찾고 반환하는 데 도움이 될 수 있습니다. 그러나 때로는 다음 스크린 샷과 같이 일치하는 모든 값을 vlookup하고 반환해야 할 수도 있습니다. Google 시트에서이 작업을 해결하는 좋고 쉬운 방법이 있습니까?
  • 드롭 다운 목록에서 Vlookup 및 여러 값 반환
  • Excel에서 드롭 다운 목록에서 여러 해당 값을 조회하고 반환하는 방법은 다음과 같습니다. 즉, 드롭 다운 목록에서 하나의 항목을 선택하면 다음 스크린 샷과 같이 모든 관련 값이 한 번에 표시됩니다. 이 기사에서는 솔루션을 단계별로 소개합니다.
  • Vlookup 및 Excel에서 세로로 여러 값 반환
  • 일반적으로 Vlookup 함수를 사용하여 첫 번째 해당 값을 가져올 수 있지만 때로는 특정 기준을 기반으로 일치하는 모든 레코드를 반환하려고합니다. 이 기사에서는 일치하는 모든 값을 수직, 수평 또는 단일 셀로 vlookup하고 반환하는 방법에 대해 설명합니다.
  • Vlookup 및 Excel에서 두 값 사이의 일치하는 데이터 반환
  • Excel에서는 일반적인 Vlookup 함수를 적용하여 주어진 데이터를 기반으로 해당 값을 가져올 수 있습니다. 그러나 때로는 다음 스크린 샷과 같이 두 값 사이의 일치하는 값을 vlookup하고 반환하려고합니다. Excel에서이 작업을 어떻게 처리 할 수 ​​있습니까?

 


  • 슈퍼 포뮬러 바 (여러 줄의 텍스트와 수식을 쉽게 편집 할 수 있습니다.) 레이아웃 읽기 (많은 수의 셀을 쉽게 읽고 편집합니다.) 필터링 된 범위에 붙여 넣기...
  • 셀 / 행 / 열 병합 및 데이터 보관; 셀 내용 분할; 중복 행과 합계 / 평균 결합... 중복 셀 방지; 범위 비교...
  • 중복 또는 고유 선택 행; 빈 행 선택 (모든 셀이 비어 있음); 슈퍼 찾기 및 퍼지 찾기 많은 통합 문서에서; 무작위 선택 ...
  • 정확한 사본 수식 참조를 변경하지 않고 여러 셀; 참조 자동 생성 여러 시트에; 글 머리 기호 삽입, 확인란 등 ...
  • 즐겨 찾기 및 빠른 수식 삽입, 범위, 차트 및 그림; 셀 암호화 암호로; 메일 링리스트 생성 이메일 보내기 ...
  • 텍스트 추출, 텍스트 추가, 위치 별 제거, 공간 제거; 페이징 부분합을 만들고 인쇄합니다. 셀 내용과 주석 간 변환...
  • 슈퍼 필터 (다른 시트에 필터 구성표 저장 및 적용) 고급 정렬 월 / 주 / 일, 빈도 등 특수 필터 굵은 기울임 꼴로 ...
  • 통합 문서와 워크 시트 결합; 키 열을 기반으로 테이블 병합; 데이터를 여러 시트로 분할; xls, xlsx 및 PDF 일괄 변환...
  • 피벗 테이블 그룹화 기준 주 번호, 요일 등 ... 잠금 해제되고 잠긴 셀 표시 다른 색상으로; 수식 / 이름이있는 셀 강조 표시...
kte 탭 201905
  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
officetab 하단

 

Comments (25)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, if there are duplicate values (e.g. two adams), how do i make sure that it only returns 1 adam and not 2?
This comment was minimized by the moderator on the site
Hello, Bobby,
To extract only unique matching values, you should apply the below formula:
After pasting the formula, please press Ctrl + Shift + Enter keys together to get the correct result.
=IFERROR(INDEX($B$2:$B$5, MATCH(0, COUNTIF(H1:$H$1, $B$2:$B$5)+IF($D$2:$D$5<>$G$2, 1, 0)+IF($C$2:$C$5<>$F$2, 1, 0), 0)), "")

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Hi,

Thanks for posting these examples.
I'm trying to implement this in my own sheet, but don't get it to work (maybe because I'm using an europe version of excel)?

I want to get the dates of the days that I had my shifts or that I have worked 'some' (>0) hours for a client.

So in I3 is the name and in J3 the month. K3 and L3 are the shifts (1 is worked) and hours (don't know how to set this, should be more than zero)

My expected results are in:
Shifts: I7 and I8
hours: J7

So I worked more than 0 hours for 'person 2' in oktober on 3-10-2022
had shifts for person 2 on '10-10-2022' and 28-10-2022

When I add '=INDEX($B$2:$B$11, SMALL(IF(COUNTIF($F$2, $C$2:$C$11)*COUNTIF($G$2, $D$2:$D$11), ROW($A$2:$D$11)-MIN(ROW($A$2:$D$11))+1), ROW(A1)), COLUMN(A1))' in my excel sheet, it doesn't allow the comma between the different parts of the formula.
So I need to change them to ';'.
But when I try it it always says: '#NAME?'

So can someone help me with this?

Kind regards,

Bas
[img]https://drive.google.com/file/d/1iIPQKuj_PNhqWyWlwJ4IQTqGNEd6B9Hw/view?usp=share_link[/img]
This comment was minimized by the moderator on the site
Hi,

First, thank you for sharing!

Can you please provide a solution to the case below:

I have 3 columns (A: Containing reference information, B: Containing information to be searched, C: Search result)

Image url is provided below

https://ibb.co/VHCd09K

Column A-------------------------Column B------------Column C
File Name-------------------------Name----------------File Name, Document Name, Element Name, Name
Changed Element-----------------Element--------------Changed Element, Element Name, Element ID
Column Location
Document Name
Element Name
Name
Category
Warranty
Slope
Element ID

What I need is to search in column A for any partial match with cell B2 (Name) or B3 (Element) and get the result in one cell,

Thank you, Behzad
This comment was minimized by the moderator on the site
Hello, Behzad
Maybe the below User Defined Function can help you.
Public Function ConcatPartLookUp(rngInput As Range, rngSource As Range, Optional strDelimiter As String, Optional blCaseSensitive)
Dim rng As Range
If strDelimiter = "" Then strDelimiter = ","
If IsMissing(blCaseSensitive) Then
    blCaseSensitive = False
Else
    blCaseSensitive = True
End If
For Each rng In rngSource
    If blCaseSensitive Then
        If InStr(1, rng.Value, rngInput.Value, vbBinaryCompare) > 0 Then ConcatPartLookUp = ConcatPartLookUp & strDelimiter & rng.Value
    Else
        If InStr(1, rng.Value, rngInput.Value, vbTextCompare) > 0 Then ConcatPartLookUp = ConcatPartLookUp & strDelimiter & rng.Value
    End If
Next
If Len(ConcatPartLookUp) > 0 Then ConcatPartLookUp = Mid(ConcatPartLookUp, 2, Len(ConcatPartLookUp))
End Function


After copying and pasting this code, and then use this formula:=ConcatPartLookUp(B2,$A$2:$A$8) to get the result you need.
Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Heyi, thank you for the formula. It worked for "fixed" values / text as criterias. However, one of the criterias i'm trying to use is a condition (values <>0 ), but does not work the described formula. Do you guys know what should i change to adapt the formula so I can have a condition as one of the criterias, please?

Best,

João
This comment was minimized by the moderator on the site
Hello, Marcus
To solve your problem, please view this article:
https://www.extendoffice.com/documents/excel/6393-excel-vlookup-function.html#b3-2
There are some detailed explanations of this task. You just need to change the criteira to your own.
Thank you!
This comment was minimized by the moderator on the site
Hi,

if in cell H1 i write "Name" and wanted to link that with the formula, how would that work?
Then I could write "ID" in cell H1 and would automatically get as a result: AA1004; DD1009; PP1023 (for the first formula)

Thank you in advance!
This comment was minimized by the moderator on the site
Hello, Marie
Sorry, i can't get the point of your first problem, could you explain your problem more clearly and detailedly? Or you can insert a screenshot here to describe your problem.
As for the second question, you just need to change the cell reference as this:
=INDEX($A$2:$A$11, SMALL(IF(COUNTIF($F$2, $C$2:$C$11)*COUNTIF($G$2, $D$2:$D$11), ROW($A$2:$D$11)-MIN(ROW($A$2:$D$11))+1), ROW(A1)), COLUMN(A1))

Remeber to press Ctrl + Shift + Enter keys together.
Please try, hope it can help you!
This comment was minimized by the moderator on the site
Hello,
what would be needed to expand the first formula in the following case:
Some IDs are Blank (e.g. cell A5 is blank) and I would like an additional condition outputting lines only when the IDs are not blank. (So the output should then be James and Abdul.
Thanks!
This comment was minimized by the moderator on the site
Hello, Jo,
To solve your problem, please apply the below formula:
=INDEX($B$2:$B$11, SMALL(IF(COUNTIF($F$2, $C$2:$C$11)*COUNTIF($G$2, $D$2:$D$11)*($A$2:$A$11<>0), ROW($A$2:$D$11)-MIN(ROW($A$2:$D$11))+1), ROW(A1)), COLUMN(A1))

Please have a ry, hope it can help you!
This comment was minimized by the moderator on the site
hello,
ive tried using the formula and it either generates a value of 0 or the image attached
This comment was minimized by the moderator on the site
Hello, Milku
Your screenshot showed WPS software of MAC version, so I am not sure whether our formula is available.
I uploaded an Excel file to here, you can try to see if it can calculate correctly in you environment.
Thank you!
This comment was minimized by the moderator on the site
When I use the second formula and drag down, nothing appears. The formula result (fx) says it should be returning something but it is blank. How do I correct this?
This comment was minimized by the moderator on the site
Hello Alysia,

Glad to help. I tried the second formula in the article and drag the formula down, the rest of results were returned. I think there may be two reasons for your problem. First, maybe you forget to press Ctrl + Shift + Enter keys to enter the formula. Second, the matching result is only one, so no other results are not returned. Please have a check.

Sincerely,
Mandy
This comment was minimized by the moderator on the site
Hi,

I was wondering if it at all possible to enter a 2nd criteria but from the same range as the 1st criteria,

For example with the used example above i would like to search for the names of people from both America and France So cell F3 would have France, Scarlett & Andrew would also populate in the list in Column G

Thank you for assistance in advance.
This comment was minimized by the moderator on the site
Hello Nick,

Glad to help. If you want to get the names of people from both America and France, I advise you to use our formula twice to get the result. Please see the screenshot, In F2 and G2 are values "United States" and "France". Apply formula =IFERROR(INDEX($B$2:$B$11, SMALL(IF($F$2=$D$2:$D$11, ROW($D$2:$D$11)-ROW($D$2)+1), ROW(1:1))),"" ) to get the results for America. And apply formula =IFERROR(INDEX($B$2:$B$11, SMALL(IF($G$2=$D$2:$D$11, ROW($D$2:$D$11)-ROW($D$2)+1), ROW(1:1))),"" ) to get the results for France. It's simple. Please have a try.

Sincerely,
Mandy
This comment was minimized by the moderator on the site
In the first example, what change to the formula would be needed to return everyone who was less than 28 years old?
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations