PC Review


Reply
Thread Tools Rate Thread

displaying error message if end date is prior to begin date

 
 
stef
Guest
Posts: n/a
 
      26th Sep 2007
Excel 2002 SP3
Win XP HE

Hi,

1) In cell B3 I have a beginning date. In B4, an ending date.

The dates are selected from a dropdown list Form I created which uses a
list of dates in a different sheet (column--named as range).

How can I display an error message if the ending date is equal to or
prior to beginning date? And/or the beginning date is = to or later than
ending date? It seems redundant to mention it twice but but the error
could be made on selecting wrong dates in B3 and/or B4.

2) Same question but setup is:
B3 has the beginning date. B4 an ending date. And/or the beginning date
is = to or later than ending date? It seems redundant to mention it
twice but but the error could be made on selecting wrong dates in B3
and/or B4.

This time, I use Validation dropdown lists in each of B2 to selec the
dates.

How can I display an error message if the ending date is equal to or
prior to beginning date?
 
Reply With Quote
 
 
 
 
Sandy Mann
Guest
Posts: n/a
 
      26th Sep 2007
Try using Conditional Formatting with:

=AND($B$3<>"",$B$4<>"",$B$3>=$B$4)

The formula in B3 Conditional Formatting and:

=AND($B$4<>"",$B$3<>"",$B$4<=$B$3)

Won't give a error message but will highlight the fac that gthe dates are
wrong.

Or you can have in another cell:

=IF(AND(B3<>"",B4<>"",B3>=B4),"Error in dates!","")

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(E-Mail Removed)
Replace @mailinator.com with @tiscali.co.uk


"stef" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Excel 2002 SP3
> Win XP HE
>
> Hi,
>
> 1) In cell B3 I have a beginning date. In B4, an ending date.
>
> The dates are selected from a dropdown list Form I created which uses a
> list of dates in a different sheet (column--named as range).
>
> How can I display an error message if the ending date is equal to or prior
> to beginning date? And/or the beginning date is = to or later than ending
> date? It seems redundant to mention it twice but but the error could be
> made on selecting wrong dates in B3 and/or B4.
>
> 2) Same question but setup is:
> B3 has the beginning date. B4 an ending date. And/or the beginning date
> is = to or later than ending date? It seems redundant to mention it twice
> but but the error could be made on selecting wrong dates in B3 and/or B4.
>
> This time, I use Validation dropdown lists in each of B2 to selec the
> dates.
>
> How can I display an error message if the ending date is equal to or prior
> to beginning date?
>



 
Reply With Quote
 
stef
Guest
Posts: n/a
 
      26th Sep 2007
Thanks.
Highlighting is not enough as it wouldn't tell the remote user exactly
what is wrong.
The second solution is better. But not quite exactly what I was looking
for--as I was more trying to find a solution similar to a warning
message that a Data Validation option will give, etc., IF that is even
possible.
> =IF(AND(B3<>"",B4<>"",B3>=B4),"Error in dates!","")

does work of course.



Sandy Mann wrote:
> Try using Conditional Formatting with:
>
> =AND($B$3<>"",$B$4<>"",$B$3>=$B$4)
>
> The formula in B3 Conditional Formatting and:
>
> =AND($B$4<>"",$B$3<>"",$B$4<=$B$3)
>
> Won't give a error message but will highlight the fac that gthe dates are
> wrong.
>
> Or you can have in another cell:
>
> =IF(AND(B3<>"",B4<>"",B3>=B4),"Error in dates!","")
>

 
Reply With Quote
 
Sandy Mann
Guest
Posts: n/a
 
      26th Sep 2007
Depending on how many dates you have it may be possible for you to use Debra
Dalgleish's dependant Validation dropdown:

http://www.contextures.com/xlDataVal13.html

There is a zip file you can download then try changing the names that Debra
has for dates and expanding the range in the Named list. It will mean that
you cannot select an ending date before you have selected a beginning date
and then you will only be presented with dates after the beginning date.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(E-Mail Removed)
Replace @mailinator.com with @tiscali.co.uk


"stef" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Thanks.
> Highlighting is not enough as it wouldn't tell the remote user exactly
> what is wrong.
> The second solution is better. But not quite exactly what I was looking
> for--as I was more trying to find a solution similar to a warning message
> that a Data Validation option will give, etc., IF that is even possible.
>> =IF(AND(B3<>"",B4<>"",B3>=B4),"Error in dates!","")

> does work of course.
>
>
>
> Sandy Mann wrote:
>> Try using Conditional Formatting with:
>>
>> =AND($B$3<>"",$B$4<>"",$B$3>=$B$4)
>>
>> The formula in B3 Conditional Formatting and:
>>
>> =AND($B$4<>"",$B$3<>"",$B$4<=$B$3)
>>
>> Won't give a error message but will highlight the fac that gthe dates are
>> wrong.
>>
>> Or you can have in another cell:
>>
>> =IF(AND(B3<>"",B4<>"",B3>=B4),"Error in dates!","")
>>

>



 
Reply With Quote
 
stef
Guest
Posts: n/a
 
      27th Sep 2007
That sounds interesting.
I will download it and play around with it; and post the results back here.
Thanks a lot!

Sandy Mann wrote:
> Depending on how many dates you have it may be possible for you to use Debra
> Dalgleish's dependant Validation dropdown:
>
> http://www.contextures.com/xlDataVal13.html
>
> There is a zip file you can download then try changing the names that Debra
> has for dates and expanding the range in the Named list. It will mean that
> you cannot select an ending date before you have selected a beginning date
> and then you will only be presented with dates after the beginning date.
>

 
Reply With Quote
 
Sandy Mann
Guest
Posts: n/a
 
      27th Sep 2007
I am sure that you will not ahve any trouble because Debra's instruction are
comprehensive, but if you do need any further assisitance then post back
again.

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(E-Mail Removed)
Replace @mailinator.com with @tiscali.co.uk


"stef" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> That sounds interesting.
> I will download it and play around with it; and post the results back
> here.
> Thanks a lot!
>
> Sandy Mann wrote:
>> Depending on how many dates you have it may be possible for you to use
>> Debra Dalgleish's dependant Validation dropdown:
>>
>> http://www.contextures.com/xlDataVal13.html
>>
>> There is a zip file you can download then try changing the names that
>> Debra has for dates and expanding the range in the Named list. It will
>> mean that you cannot select an ending date before you have selected a
>> beginning date and then you will only be presented with dates after the
>> beginning date.
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dates - Need to display date one month prior to user-entered date brettopp Microsoft Excel Worksheet Functions 13 3rd Dec 2007 05:58 PM
Show a Message Prior to Due Date DocDeb Microsoft Excel Worksheet Functions 0 28th Nov 2007 08:44 PM
Keep original date on prior word documents when viewed date stays =?Utf-8?B?cGF0cmlzaA==?= Microsoft Word Document Management 1 28th Sep 2006 03:23 PM
Coding to show first _weekday_ prior to a date, when date calculation happens to fall on weekend? StargateFan Microsoft Excel Programming 5 9th Dec 2004 09:06 AM
adding work days to a begin date to derive the end date Susan Microsoft Access Queries 1 28th Oct 2004 05:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:23 AM.