Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Neil
 
Posts: n/a
Default Custom data validation problem

I would like to validate cells according to the following rule ...

The cell can contain the following:
A single zero "0" or
a single period "." or
a string of any length consisting of the letters R, W, B, L

Eg all the following are valid
0
..
rrr
bbbbb
bbrrl
l
wrbblllrrrrbbbbbb

The following are invalid
00
0r
rrrbbbh
..rbl

Is this possible using a custom validation?

Thanks in advance.
Neil


  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Custom data validation problem

How about:
Data|Validation|Custom:
formula is:
=OR(A1=0,A1="0",A1=".",
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(lower( A1),"r",""),"l",""),
"b",""),"w","")="")
all one line

=substitute() is case sensitive. If you really meant rlbw--and not RLBW, then
get rid of that lower() stuff.



Neil wrote:

I would like to validate cells according to the following rule ...

The cell can contain the following:
A single zero "0" or
a single period "." or
a string of any length consisting of the letters R, W, B, L

Eg all the following are valid
0
.
rrr
bbbbb
bbrrl
l
wrbblllrrrrbbbbbb

The following are invalid
00
0r
rrrbbbh
.rbl

Is this possible using a custom validation?

Thanks in advance.
Neil


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Neil
 
Posts: n/a
Default Custom data validation problem

It's ok now, I have solved the problem, thanks to MrExcel

Here is how to do it if anyone is interested ...

=OR(A1="0",A1=".",LEN(SUBSTITUTE(SUBSTITUTE(SUBSTI TUTE(SUBSTITUTE(UPPER(A1),"R",""),"W",""),"B",""), "L",""))=0)

Neil



"Neil" wrote in message
...
I would like to validate cells according to the following rule ...

The cell can contain the following:
A single zero "0" or
a single period "." or
a string of any length consisting of the letters R, W, B, L

Eg all the following are valid
0
.
rrr
bbbbb
bbrrl
l
wrbblllrrrrbbbbbb

The following are invalid
00
0r
rrrbbbh
.rbl

Is this possible using a custom validation?

Thanks in advance.
Neil




  #4   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default Custom data validation problem

You got an answer here from Dave Peterson, do you want people to be able to
enter zeros? Then you should use his solution since the one you got will
only prevent text zeros, not numeric zeros

--

Regards,

Peo Sjoblom


"Neil" wrote in message
...
It's ok now, I have solved the problem, thanks to MrExcel

Here is how to do it if anyone is interested ...


=OR(A1="0",A1=".",LEN(SUBSTITUTE(SUBSTITUTE(SUBSTI TUTE(SUBSTITUTE(UPPER(A1),
"R",""),"W",""),"B",""),"L",""))=0)

Neil



"Neil" wrote in message
...
I would like to validate cells according to the following rule ...

The cell can contain the following:
A single zero "0" or
a single period "." or
a string of any length consisting of the letters R, W, B, L

Eg all the following are valid
0
.
rrr
bbbbb
bbrrl
l
wrbblllrrrrbbbbbb

The following are invalid
00
0r
rrrbbbh
.rbl

Is this possible using a custom validation?

Thanks in advance.
Neil






  #5   Report Post  
Posted to microsoft.public.excel.misc
Neil
 
Posts: n/a
Default Custom data validation problem

I havn't seen the reply here from Dave Peterson, but I already replaced the
"0" with 0 and it seems to work ok

Thanks for your time
Neil

"Peo Sjoblom" wrote in message
...
You got an answer here from Dave Peterson, do you want people to be able
to
enter zeros? Then you should use his solution since the one you got will
only prevent text zeros, not numeric zeros

--

Regards,

Peo Sjoblom


"Neil" wrote in message
...
It's ok now, I have solved the problem, thanks to MrExcel

Here is how to do it if anyone is interested ...


=OR(A1="0",A1=".",LEN(SUBSTITUTE(SUBSTITUTE(SUBSTI TUTE(SUBSTITUTE(UPPER(A1),
"R",""),"W",""),"B",""),"L",""))=0)

Neil



"Neil" wrote in message
...
I would like to validate cells according to the following rule ...

The cell can contain the following:
A single zero "0" or
a single period "." or
a string of any length consisting of the letters R, W, B, L

Eg all the following are valid
0
.
rrr
bbbbb
bbrrl
l
wrbblllrrrrbbbbbb

The following are invalid
00
0r
rrrbbbh
.rbl

Is this possible using a custom validation?

Thanks in advance.
Neil








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
Data Validation formula problem rrucksdashel Excel Discussion (Misc queries) 1 September 29th 05 05:48 AM
Automatic Data Validation drop down creation Buddhapenguin Excel Discussion (Misc queries) 1 May 12th 05 08:41 PM
Data Validation Mike R Excel Discussion (Misc queries) 11 May 6th 05 02:38 AM
Data Validation gbeard Excel Worksheet Functions 1 May 3rd 05 09:09 AM
Excel2K: Is it possible to use dynamic named ranges in custom data validation formula? Arvi Laanemets Excel Discussion (Misc queries) 0 December 2nd 04 11:29 AM


All times are GMT +1. The time now is 11:14 AM.

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

About Us

"It's about Microsoft Excel"