Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 88
Default validate date entered

i want to validate the date entered as a Sunday - if the user enters a date
that is not a Sunday, the user cannot continue.

cell A1 - user enters the date (the cell is formatted as custom yyyy-mm-dd)
cell A2 - text(a1,"dddd") returns back the day of the week

is there a way to validate the value as a Sunday date.

jat

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default validate date entered

Select cell A1
Goto the menu DataValidation
Allow: Custom
Formula: =WEEKDAY(A1)=1

You can use custom input or error alert messages if you want.

OK out

--
Biff
Microsoft Excel MVP


"jatman" wrote in message
...
i want to validate the date entered as a Sunday - if the user enters a date
that is not a Sunday, the user cannot continue.

cell A1 - user enters the date (the cell is formatted as custom
yyyy-mm-dd)
cell A2 - text(a1,"dddd") returns back the day of the week

is there a way to validate the value as a Sunday date.

jat



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default validate date entered

Not sure how you want to do the validation, but this will return TRUE if the
date in A1 is a Sunday and FALSE otherwise...

=WEEKDAY(A1)=1

So, you could do some variation on this for your validation formula...

=IF(WEEKDAY(A1)=1,"That date is a Sunday","Sorry, it's not a Sunday")

--
Rick (MVP - Excel)


"jatman" wrote in message
...
i want to validate the date entered as a Sunday - if the user enters a date
that is not a Sunday, the user cannot continue.

cell A1 - user enters the date (the cell is formatted as custom
yyyy-mm-dd)
cell A2 - text(a1,"dddd") returns back the day of the week

is there a way to validate the value as a Sunday date.

jat


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default validate date entered

Add Data Validation to A1. Select Data (ribbon tab in XL2007 or menu bar in
earlier versions) Data Validation set Allow to Custom for Formula
enter
=WEEKDAY(A1)=1) on the Error Alert tab, set the message to display if
a non-Sunday date is entered OK.

Hope this helps,

Hutch

"jatman" wrote:

i want to validate the date entered as a Sunday - if the user enters a date
that is not a Sunday, the user cannot continue.

cell A1 - user enters the date (the cell is formatted as custom yyyy-mm-dd)
cell A2 - text(a1,"dddd") returns back the day of the week

is there a way to validate the value as a Sunday date.

jat

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validate date entry in a text box. GoBow777 Excel Discussion (Misc queries) 0 July 30th 08 08:46 PM
validate alternate day date tikchye_oldLearner57 Excel Discussion (Misc queries) 7 March 13th 07 06:40 PM
validate a date range tikchye_oldLearner57 Excel Discussion (Misc queries) 4 March 13th 07 01:17 AM
Get Day from Date to Validate David Excel Discussion (Misc queries) 2 August 20th 06 02:31 PM
How can i use a command button to validate date and time kcdonaldson Excel Discussion (Misc queries) 0 December 9th 05 04:03 PM


All times are GMT +1. The time now is 06:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"