Forum Discussion

ChrisK1820's avatar
ChrisK1820
Copper Contributor
Mar 28, 2023

Excel multiple data validation

I want to create two lots of data validation in one column based on another column. If i enter 'Calendar' in to column 'E' i want to only be able to enter a date in to the same row in column 'J'. But if the same column 'E' entry is 'Hours' then i only want to be able to enter hh:mm style entry in that 'j' cell.

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    ChrisK1820 

    You can use data validation in Excel to restrict data entry based on another column.

    You can create two lots of data validation in one column based on another column by using a custom formula.

     Here’s how you can do it:

    1. Select the cells you want to apply data validation to.
    2. Go to the Data tab on the ribbon and click on Data Validation.
    3. In the Data Validation dialog box, select Custom from the Allow drop-down list.
    4. In the Formula box, enter this formula: =IF(E1=“Calendar”,ISDATE(J1),AND(E1=“Hours”,TIMEVALUE(J1)))
    5. Click OK.

    This formula will allow you to enter a date in column J if column E contains “Calendar”

    and will allow you to enter a time value in column J if column E contains “Hours”.

     

    I hope this helps!

    • ChrisK1820's avatar
      ChrisK1820
      Copper Contributor
      Thanks, i think it was the 'ISDATE' and 'TIMEVALUE' bits that i was struggling with.
      • NikolinoDE's avatar
        NikolinoDE
        Gold Contributor
        Nice to hear that you made progress with your project.
        I wish you continued success with Excel.

Resources