Forum Discussion

DMac6160's avatar
DMac6160
Copper Contributor
Nov 02, 2024

Conditional Data Validation

Hello:

 

I'm hoping the Excel user community can help me with a question. I have a worksheet that contains a drop-down list in Column B. Available values are ATM, CHK, DEP, and EBT. I would like to set up a validation rule that would require the user to enter a value from 0000-9999 in Column C if "CHK" is selected in Column B. How can I do this?

 

Your feedback and advice are greatly appreciated!

 

- DM

  • DMac6160 

    Let's say you want to apply this to C2:C100.

    Select this range, C2 should be the active cell in the selection.

    Set the number format to the custom format 0000

    On the Data tab of the ribbon, click Data Validation.

    Select Custom from the Allow list, then enter the following formula:

     

    =OR(B2<>"CHK", AND(C2>=0, C2<=9999, MOD(C2, 1)=0))

     

    If you wish, enter messages in the Input Message and Error Alert tabs, then click OK.

Resources