ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Data Validation (https://www.excelbanter.com/excel-discussion-misc-queries/15222-data-validation.html)

Pete

Data Validation
 
How can I restrict entry to ceels between the times of
18:00 & 06:00, this must allow 22:00 etc

This is so it covers the night shift in 24hr format

Pete

Debra Dalgleish

Select the cells
Choose DataValidation
From the Allow dropdown, choose Custom
In the Formula box, type a formula that refers to the active cell, e.g.:

=OR(B5=0.75,B5<=0.25)

Click OK

Pete wrote:
How can I restrict entry to ceels between the times of
18:00 & 06:00, this must allow 22:00 etc

This is so it covers the night shift in 24hr format

Pete



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


Dave Peterson

One way is to add 6 hours to what's in the cell and then check that to see if
it's still less than noon.

=MOD((A1+TIME(6,0,0)),1)<TIME(12,0,0)

(maybe "<=" instead of "<")

Pete wrote:

How can I restrict entry to ceels between the times of
18:00 & 06:00, this must allow 22:00 etc

This is so it covers the night shift in 24hr format

Pete


--

Dave Peterson

Ragdyer

Try this:
Say times to be entered in Column E
Select E1:E10, then,
<Data <Validation,
In "Allow" window, check "custom",
In Formula box, enter:

=OR(E1=TIME(18,,),E1<=TIME(6,,))
Then <OK.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Pete" wrote in message
...
How can I restrict entry to ceels between the times of
18:00 & 06:00, this must allow 22:00 etc

This is so it covers the night shift in 24hr format

Pete




All times are GMT +1. The time now is 04:41 AM.

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