ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Data Validation - 1st or 16th of the month only (https://www.excelbanter.com/excel-programming/426185-data-validation-1st-16th-month-only.html)

John[_140_]

Data Validation - 1st or 16th of the month only
 
In a certain cell the user enters a date. I would like data validation to
accept the entry only if the day is the 1st or 16th of the month. How do I
do that?



Bernd P

Data Validation - 1st or 16th of the month only
 
(DAY(A1)=1)+(DAY(A1)=16)

or

OR(DAY(A1)=1),DAY(A1)=16)

Gary''s Student

Data Validation - 1st or 16th of the month only
 
Use Formula is:

=OR((DAY(F1)=1),(DAY(F1)=16))

for the validation rule in F1
--
Gary''s Student - gsnu200841


"John" wrote:

In a certain cell the user enters a date. I would like data validation to
accept the entry only if the day is the 1st or 16th of the month. How do I
do that?




Ron Coderre[_3_]

Data Validation - 1st or 16th of the month only
 
Select the range of cells to be impacted

Example with A2:A10...with A2 as the active cell
From the Excel Main Menu:
<data<validation
Settings Tab:
....Allow: Custom
....Formula: =AND(A230000,OR(DAY(A2)=1,DAY(A2)=16))
Error Alert Tab:
....Title: Invalid Entry
....Error message: Date must be the 1st or 16th of the month.
Click: OK

Note: I only used 30000 since most recent
dates are larger than 30000
(which happens to be 18-Feb-1982)

Does that help?

Regards,

Ron Coderre
Microsoft MVP (Excel)

"John" wrote in message
...
In a certain cell the user enters a date. I would like data validation to
accept the entry only if the day is the 1st or 16th of the month. How do I
do that?



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

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