Dual Data Validation in Excel

Anonymous
2025-03-01T09:31:46+00:00

Hi,

I want the user to input time in D12 in hh:mm 24hrs format only when cell D9 is not "--".

So, it's a dual validation:

  1. Entered time must be in hh:mm format (24 hrs)
  2. Cell D9 must not have "--".

Any help?

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points MVP Volunteer Moderator
2025-03-01T11:05:33+00:00

Select D12.

Format it as hh:mm

On the Data tab, select Data Validation.

Select Custom from the Allow drop-down list.

Enter the following formula in the Formula box:

=AND(ISNUMBER(D12), D12>=0, D12<1, D9<>"--")

If you wish, enter an instruction in the Input Message tab, and/or an appropriate error message in the Error Alert tab.

Click OK,

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2025-03-28T12:26:06+00:00

    Perfect, thank you!!

    Was this answer helpful?

    0 comments No comments