Computer >> 컴퓨터 >  >> 소프트웨어 >> Office

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

IF 문을 사용하는 가장 쉬운 방법을 찾고 있다면 데이터 검증에서 Excel에서 수식을 사용하면 이 기사가 유용하다는 것을 알게 될 것입니다. 데이터 검증 드롭다운 목록을 만들거나 범위에 지정된 데이터만 입력하는 데 유용할 수 있습니다.
IF 문 사용법에 대해 자세히 알아보려면 데이터 검증에서 공식, 주요 기사를 시작하겠습니다.

통합 문서 다운로드

엑셀의 데이터 검증 수식에서 IF 문을 사용하는 6가지 방법

여기에 일부 제품의 기록과 해당 판매원의 회사 이름이 있습니다. 이 데이터 세트를 사용하여 IF 문 을 사용하는 방법을 보여 주려고 합니다. 데이터 유효성 검사에서 Excel의 수식

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Microsoft Excel 365를 사용했습니다. 여기에서 버전을 확인하고 편의에 따라 다른 버전을 사용할 수 있습니다.

방법-1 :IF 문을 사용하여 데이터 유효성 검사 공식의 도움으로 조건부 목록 만들기

조건부 목록을 만들기 위해 여기 이름 헤더 아래 직원의 전체 이름을 정렬했습니다. 직원의 이름에는 전체 이름 헤더를 사용했습니다. . IF 함수 사용 데이터 유효성 검사 공식을 오른쪽 테이블에 조건부 목록으로 만듭니다.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

단계 :
E3:E12 범위 선택 그런 다음 데이터 로 이동합니다. 탭>> 데이터 도구 그룹>> 데이터 검증 드롭다운>> 데이터 검증 옵션.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

그런 다음 데이터 검증 대화 상자가 나타납니다.
목록 선택 허용 옵션 상자에 입력하고 출처 에 다음 공식을 작성하십시오. 상자를 클릭하고 확인을 클릭합니다. .

=IF($E$3=$B$3,$C$3:$C$12,$B$3:$B$12)

여기 $E$3 드롭다운 목록에서 헤더를 선택하려는 셀입니다. $B$3 첫 번째 열의 헤더 이름입니다. 이 두 값이 같을 때 IF $C$3:$C$12 범위의 목록을 반환합니다. , 그렇지 않으면 목록에 $B$3:$B$12 범위의 값이 포함됩니다. .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

➤ 따라서 E3 셀의 드롭다운 기호를 클릭하면 , 이름 헤더를 가져옵니다. 선택했습니다.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

➤ 셀 E4의 이름 목록에서 이름을 선택합니다. .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

이런 식으로 이름 헤더와 함께 영업 사원 이름의 이름을 가져옵니다. .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

이름 에서 헤더 이름을 변경할 수 있습니다. 이름 으로 E3 셀에서 .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

➤ 나머지 셀의 목록에서 전체 이름을 선택합니다.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

마지막으로 해당 헤더가 있는 직원의 전체 이름을 얻을 수 있습니다.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

자세히 알아보기: Excel의 표에서 데이터 유효성 검사 목록을 만드는 방법(3가지 방법)

방법-2 :데이터 유효성 검사 공식에서 IF 문을 사용하여 종속 드롭다운 목록 만들기

이 섹션에서는 Item 목록은 카테고리 에 따라 다릅니다. 목록.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

단계 :
E5 셀 선택 을 클릭한 다음 데이터 탭>> 데이터 도구 그룹>> 데이터 검증 드롭다운>> 데이터 검증 옵션.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

그 후 데이터 검증 대화 상자가 나타납니다.
목록 선택 허용 옵션 상자를 클릭하고 출처 에 다음 공식을 작성하십시오. 상자

=$B$3:$C$3

여기 $B$3 헤더는 과일 입니다. 및 $C$3 헤더는 야채입니다. .

확인을 누릅니다. .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

E5 셀의 드롭다운 기호를 클릭한 후 , 목록에 헤더 이름이 표시되고 과일 을 선택하겠습니다. 이 목록에서.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

이제 F5 셀에 항목 목록을 만듭니다. .
목록 선택 허용 옵션 상자를 클릭하고 출처 에 다음 공식을 작성하십시오. 상자

=IF($E$5="Fruits",$B$4:$B$12,$C$4:$C$12)

셀 값이 $E$5 일 때 '과일'과 동일합니다. , 만약 $B$4:$B$12 범위를 반환합니다. 그렇지 않으면 목록에 $C$4:$C$12 범위가 포함됩니다. .

확인을 누릅니다. .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

이제 Apple과 같은 과일 품목을 선택하기 위해 , F5 셀의 드롭다운 목록을 클릭하십시오. 목록에서 이 항목을 선택하십시오.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

그러면 원하는 항목을 얻을 수 있습니다. Apple 과일 카테고리의 경우 .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

카테고리 를 선택할 수 있습니다. 야채로 또한 목록에서.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

그런 다음 항목 목록에서 야채 목록을 가져오고 첫 번째 야채(원하는 것)를 선택합니다. 양배추 여기에서.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

마지막으로 항목 양배추 를 얻습니다. 해당 카테고리 야채 .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

자세히 알아보기: Excel에서 다중 선택으로 데이터 유효성 검사 드롭다운 목록 만들기

방법-3 :Excel의 데이터 유효성 검사 수식에서 IF 문 및 명명된 범위 사용

여기에서는 IF 함수 와 함께 명명된 범위를 사용합니다. 데이터 검증 드롭다운 목록을 만드는 수식입니다.
과일의 이름을 과일 으로 지정했습니다. 야채와 같은 다양한 야채 .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

단계 :
E5 셀 선택 을 클릭한 다음 데이터 탭>> 데이터 도구 Group> > Data Validation Dropdown>> Data Validation Option.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Afterward, the Data Validation 대화 상자가 나타납니다.
➤ Select the List option in the Allow box, and write the following formula in the Source box

=$B$3:$C$3

Here, $B$3 is the header Fruits and $C$3 is the header Vegetables .

➤ Press OK .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

➤ Now, click on the dropdown symbol of cell E5 , you will get the header names on the list, and select Fruits from this list.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Now, it’s time to make the items list in cell F5 .
➤ Select the List option in the Allow box, and write the following formula in the Source box

=IF($E$5="Fruits",Fruits,Vegetables)

When the value of the cell $E$5 will be equal to “Fruits” , IF will return the named range Fruits as a list otherwise the list will contain the named range Vegetables .

➤ Press OK .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

➤ Click on the dropdown list of cell F5 , and select the item Apple 목록에서.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Then, you will get your desired item Apple for the category Fruits .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

➤ Select the item Cabbage from the list for the category Vegetables .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Eventually, we are getting the Item Cabbage for the corresponding Category Vegetables .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

자세히 알아보기: How to Use Named Range for Data Validation List with VBA in Excel

유사한 수치:

  • Excel 데이터 유효성 검사 영숫자만(사용자 지정 수식 사용)
  • Excel VBA to Create Data Validation List from Array
  • Excel Data Validation Based on Another Cell Value

방법-4 :Using the IF and INDIRECT Functions in Data Validation Formula in Excel

Here, we will be using the INDIRECT function along with the IF function to create a data validation 공식. And we have the following named ranges Fruits and Vegetables for the fruits range and vegetables range respectively.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Steps :
➤ Select the cell F5 , and then, go to the Data Tab>> Data Tools Group> > Data Validation Dropdown>> Data Validation Option.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

After that, the Data Validation 대화 상자가 나타납니다.
➤ Select the List option in the Allow box, and write the following formula in the Source box

=IF($E$5="",Fruits,INDIRECT($E$5))

When the value of the cell $E$5 will be equal to Blank , IF will return the named range Fruits as a list otherwise INDIRECT($E$5) will check the value in the cell $E$5 and then link the value as a reference to the corresponding named range.

➤ Press OK .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

➤ Here, we have a blank in cell E5 , and for this blank, we are having the list of fruits in the dropdown list of cell F5 , and then select the first one Apple 목록에서.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

For the blank as a Category , we are having the Item as a fruit Apple .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Now, you can write down the Category as Vegetables , and then you will get the list of vegetables in cell F5 .|
➤ Select Cabbage from the vegetable list of the Item 칼럼.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Eventually, we are getting the Item Cabbage for the corresponding Category Vegetables .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

자세히 알아보기: How to Create Excel Drop Down List for Data Validation (8 Ways)

방법-5 :Using Nested IF Functions in Data Validation Formula

Here, we are going to use nested IF functions for multiple conditions in a Data Validation formula to create a dropdown list for the Fruits , Vegetables , and Fruits .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Steps :
➤ Select the cell E5 , and then, go to the Data Tab>> Data Tools Group> > Data Validation Dropdown>> Data Validation Option.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Then, the Data Validation 대화 상자가 나타납니다.
➤ Select the List option in the Allow box, and write the following formula in the Source box

=$B$3:$C$3

Here, $B$3 is the header Fruits and $C$3 is the header Vegetables .

➤ Press OK .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

➤ Now, click on the dropdown symbol of cell E5 , you will get the header names on the list, and select Fruits from this list.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

We will make the items list in cell F5 now.
➤ Select the List option in the Allow box and write the following formula in the Source box

=IF($E$5="Fruits",$B$4:$B$12,IF($E$5="Vegetables",$C$4:$C$12,$D$4:$D$12))

When the value of the cell $E$5 will be equal to “Fruits” , IF will return the range $B$4:$B$12 as a list, otherwise it will go to the next IF function which will check for the value “Vegetables” .
If the condition of this function is fulfilled, then it will return the range $C$4:$C$12 as a list otherwise $D$4:$D$12 will be used in the list.

➤ Press OK .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

➤ Click on the dropdown list of cell F5 , and select the item Apple 목록에서.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Then, you will get your desired item Apple for the category Fruits .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

➤ Select the item Cabbage from the list for the category Vegetables .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Then, you will have the Item Cabbage for the Category Vegetables .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

For selecting the Category as Fish you will have the list of the fishes in cell F5 of the Item 열.
➤ Select the first Item Salmon from the list or any other item.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Eventually, we are getting the Item Salmon for the Category Fish after selecting from the list.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

관련 콘텐츠: Apply Custom Data Validation for Multiple Criteria in Excel (4 Examples)

Method-6 :Using IF Statement in Data Validation Formula for Dates

Here, we will try to restrict the entries for the dates of the Delivery Date column in a way that the cells of this column will only accept the dates previous to today’s date (3/21/2022 as m/dd/yyyy format), and for entering dates greater than today’s date we will get an error message. For this purpose, we will be using the TODAY function along with the IF function .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Steps :
➤ Select the range E4:E12 , and then, go to the Data Tab>> Data Tools Group> > Data Validation Dropdown>> Data Validation Option.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Then, the Data Validation 대화 상자가 나타납니다.
➤ Select the Custom option in the Allow box, and write the following formula in the Source box

=IF($D$4:$D$12="*",$E$4:$E$12<=TODAY(),$E$4:$E$12="")

If the cells of the range $D$4:$D$12 contains any text string then the cells of the range $E$4:$E$12 will only allow the dates smaller than today’s date or 3/21/2022 .

➤ Press OK .

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

We can enter any dates without any problem except for the dates greater than today’s date as we can see from the following figure.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

But when we try to enter a date 3/28/2022 which is not either less than or equal to today’s date,

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

we are having the following error message due to the data validation formula we had set previously.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

So, we have filled the cells of the Delivery Date column with dates less than today’s date.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

Related Content:How to Use Data Validation in Excel with Color (4 Ways)

연습 섹션

For doing practice by yourself we have provided a Practice section like below in a sheet named Practice . Please do it by yourself.

Excel의 데이터 유효성 검사 공식에서 IF 문을 사용하는 방법(6가지 방법)

결론

In this article, we tried to cover the ways to use the IF statement in a Data Validation formula in Excel easily. Hope you will find it useful. If you have any suggestions or questions, feel free to share them in the comment section.

관련 기사

  • Excel Data Validation Drop Down List with Filter (2 Methods)
  • How to Apply Multiple Data Validation in One Cell in Excel (3 Examples)
  • Default Value in Data Validation List with Excel VBA (Macro and UserForm)
  • [Fixed] Data Validation Not Working for Copy Paste in Excel (with Solution)
  • How to Use Custom VLOOKUP Formula in Excel Data Validation