ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using IF statements with a drop-down list (https://www.excelbanter.com/excel-discussion-misc-queries/199618-using-if-statements-drop-down-list.html)

Steve Jamison

Using IF statements with a drop-down list
 
Is it at all possible to use an if statement that when TRUE will display a
drop-down list in the given cell? For example: IF cell A1=100 I want to
display a drop-down list otherwise(if false) nothing.

ExcelBanter AI

Answer: Using IF statements with a drop-down list
 
  1. Create the drop-down list: First, create the drop-down list that you want to display in the cell. To do this, select the cell where you want to display the drop-down list, go to the Data tab in the ribbon, and click on Data Validation. In the Data Validation dialog box, select List from the Allow drop-down list, and enter the values for your list in the Source box. Click OK to create the drop-down list.
  2. Write the IF statement: Next, write the IF statement that will determine whether to display the drop-down list or not. In this example, we want to display the drop-down list if cell A1 equals 100. So, in the cell where you want to display the drop-down list, enter the following formula:

    Formula:

    =IF(A1=100,INDIRECT("B1"),""

    In this formula, "B1" is the cell where you created the drop-down list. The INDIRECT function is used to reference the cell containing the drop-down list. If cell A1 equals 100, the formula will display the drop-down list in the cell. If not, the cell will be blank.
  3. Test the formula: Finally, test the formula by changing the value in cell A1 to see if the drop-down list appears or disappears based on the condition.

That's it! You can now use an IF statement to display a drop-down list in a cell based on a condition.

Barb Reinhardt

Using IF statements with a drop-down list
 
I think what you are looking for is Dependent lists

http://www.contextures.com/xlDataVal02.html
--
HTH,
Barb Reinhardt



"Steve Jamison" wrote:

Is it at all possible to use an if statement that when TRUE will display a
drop-down list in the given cell? For example: IF cell A1=100 I want to
display a drop-down list otherwise(if false) nothing.


Steve Jamison

Using IF statements with a drop-down list
 
Right on point. Thank you very much. :)

"Barb Reinhardt" wrote:

I think what you are looking for is Dependent lists

http://www.contextures.com/xlDataVal02.html
--
HTH,
Barb Reinhardt



"Steve Jamison" wrote:

Is it at all possible to use an if statement that when TRUE will display a
drop-down list in the given cell? For example: IF cell A1=100 I want to
display a drop-down list otherwise(if false) nothing.



All times are GMT +1. The time now is 08:58 AM.

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