Drop-Down List with If Statement in Excel

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on September 21, 2023

This tutorial demonstrates how to create a drop-down list with an IF statement in Excel and Google Sheets.

drop down list if statement Main

Create Custom Drop-Down List (Data Validation)

To create a drop-down list which changes according to what the user chooses, you can use an IF statement within the data validation feature.

  1. Select the cell to hold the drop down (here, C2).
  2. In the Ribbon, go to Data > Data Tools > Data Validation.

drop down list if statement 01

  1. Choose List under Allow, and then type in the Source as a formula:
    =IF(C2="Show Fruit", ShowMeat, ShowFruit)

    The formula uses two range namesShowFruit and ShowMeat. Depending on the option chosen, the corresponding list shows up in the drop-down list. Click OK.

drop down list if statement 02

  1. Click the arrow to the right of the drop-down list to see the list of available fruit.

drop down list if statement 03

  1. Click Show Meat, and then click on the drop-down list again. The list has changed to show the meat list, and the top value has changed to Show Fruit.

drop down list if statement 04

Custom Drop-Down List: Nested IF Statement

Expand on the formula above by using nested If statements.

drop down list if statement 05

  1. Select the first drop down’s cell (C2).
  2. In the Ribbon, go to Data > Data Tools > Data Validation.
  3. Choose List from the Allow drop down, and then set the range (Source) to F2:I2. Click OK.
    Note: In the picture, the range includes dollar signs. This is to lock the range of cells.

drop down list if statement 06

  1. Select the cell for the second drop down (C3).
  2. In the Ribbon, go to Data > Data Tools > Data Validation.
  3. Choose List from the Allow drop down, and then type in the formula:
    =IF($C$2="Fruit", fruit, IF(C2="Vegetables",vegetables, IF(C2="Meat", meat, seafood)))

    Once again, the formula uses range names.

drop down list if statement 07

  1. Choose the food type from the first drop-down list.

drop down list if statement 08

  1. The list in the second drop-down list changes automatically.

drop down list if statement 09

AI Formula Generator

Try for Free

See all How-To Articles