ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Two types of Data Validation in a cell? (https://www.excelbanter.com/excel-worksheet-functions/252815-two-types-data-validation-cell.html)

Lakeville

Two types of Data Validation in a cell?
 
I want to ensure that the data in a cell is either a capitalized Y or a
capitalized N. I understand how to do the data validation of a list with Y &
N. And I understand how to enforce capitalization: =EXACT(A1,UPPER(A1)).
However, I don't understand how to enforce both for the same cell.


Basil

Two types of Data Validation in a cell?
 
You could just select the 'List' option and type Y,N in the criteria. It is
case sensitive.



"Lakeville" wrote:

I want to ensure that the data in a cell is either a capitalized Y or a
capitalized N. I understand how to do the data validation of a list with Y &
N. And I understand how to enforce capitalization: =EXACT(A1,UPPER(A1)).
However, I don't understand how to enforce both for the same cell.


ryguy7272

Two types of Data Validation in a cell?
 
Data Valivation List Source = =$B$1:$B$2
In Cell B1, put Y and in Cell B2, put N


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Lakeville" wrote:

I want to ensure that the data in a cell is either a capitalized Y or a
capitalized N. I understand how to do the data validation of a list with Y &
N. And I understand how to enforce capitalization: =EXACT(A1,UPPER(A1)).
However, I don't understand how to enforce both for the same cell.


T. Valko

Two types of Data Validation in a cell?
 
Try this...

=FIND(A1,"~YN")1

Or, the robust version:

=FIND(A1,UPPER("~YN"))1

--
Biff
Microsoft Excel MVP


"Lakeville" wrote in message
...
I want to ensure that the data in a cell is either a capitalized Y or a
capitalized N. I understand how to do the data validation of a list with Y
&
N. And I understand how to enforce capitalization: =EXACT(A1,UPPER(A1)).
However, I don't understand how to enforce both for the same cell.




Lakeville

Two types of Data Validation in a cell?
 
I thought it was case sensitive, but it is not working that way for me.

"Basil" wrote:
You could just select the 'List' option and type Y,N in the criteria. It is
case sensitive.

"Lakeville" wrote:

I want to ensure that the data in a cell is either a capitalized Y or a
capitalized N. I understand how to do the data validation of a list with Y &
N. And I understand how to enforce capitalization: =EXACT(A1,UPPER(A1)).
However, I don't understand how to enforce both for the same cell.


Lakeville

Two types of Data Validation in a cell?
 
This is what I already have. If the user uses the drop down to select Y or N,
then it works properly. However, a user can manually enter lowercase y or n,
and I want to avoid that.

"ryguy7272" wrote:

Data Valivation List Source = =$B$1:$B$2
In Cell B1, put Y and in Cell B2, put N


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Lakeville" wrote:

I want to ensure that the data in a cell is either a capitalized Y or a
capitalized N. I understand how to do the data validation of a list with Y &
N. And I understand how to enforce capitalization: =EXACT(A1,UPPER(A1)).
However, I don't understand how to enforce both for the same cell.


Basil

Two types of Data Validation in a cell?
 
Strange. It would only stop them from entering the text once they navigate
away from the cell, and only if 'Show error alert after invalid data is
entered' is checked in the Error Alert tab of the Data Validation menu form.

Biff's solution should work too.

"Lakeville" wrote:

I thought it was case sensitive, but it is not working that way for me.

"Basil" wrote:
You could just select the 'List' option and type Y,N in the criteria. It is
case sensitive.

"Lakeville" wrote:

I want to ensure that the data in a cell is either a capitalized Y or a
capitalized N. I understand how to do the data validation of a list with Y &
N. And I understand how to enforce capitalization: =EXACT(A1,UPPER(A1)).
However, I don't understand how to enforce both for the same cell.


Teethless mama

Two types of Data Validation in a cell?
 
Or, the robust version:

=FIND(A1,UPPER("~YN"))1


your formula fail. If user enter both YN in a cell


Try this one:

=AND(EXACT(A1,UPPER(A1)),OR(A1="Y",A1="N"))





"T. Valko" wrote:

Try this...

=FIND(A1,"~YN")1

Or, the robust version:

=FIND(A1,UPPER("~YN"))1

--
Biff
Microsoft Excel MVP


"Lakeville" wrote in message
...
I want to ensure that the data in a cell is either a capitalized Y or a
capitalized N. I understand how to do the data validation of a list with Y
&
N. And I understand how to enforce capitalization: =EXACT(A1,UPPER(A1)).
However, I don't understand how to enforce both for the same cell.



.


T. Valko

Two types of Data Validation in a cell?
 
=FIND(A1,UPPER("~YN"))1
your formula fail. If user enter both YN in a cell


Good catch. I didn't test for that possibility.

Try this one:

=(LEN(A1)=1)*(FIND(A1,UPPER("YN")))

--
Biff
Microsoft Excel MVP


"Teethless mama" wrote in message
...
Or, the robust version:


=FIND(A1,UPPER("~YN"))1


your formula fail. If user enter both YN in a cell


Try this one:

=AND(EXACT(A1,UPPER(A1)),OR(A1="Y",A1="N"))





"T. Valko" wrote:

Try this...

=FIND(A1,"~YN")1

Or, the robust version:

=FIND(A1,UPPER("~YN"))1

--
Biff
Microsoft Excel MVP


"Lakeville" wrote in message
...
I want to ensure that the data in a cell is either a capitalized Y or a
capitalized N. I understand how to do the data validation of a list
with Y
&
N. And I understand how to enforce capitalization:
=EXACT(A1,UPPER(A1)).
However, I don't understand how to enforce both for the same cell.



.




sreenivas p

Strange.
 
If you apply the list differently then it will not allow small case one. Use comma separated values in Validation List Source.

On Friday, January 08, 2010 12:55 PM Lakeville wrote:


I want to ensure that the data in a cell is either a capitalized Y or a
capitalized N. I understand how to do the data validation of a list with Y &
N. And I understand how to enforce capitalization: =EXACT(A1,UPPER(A1)).
However, I do not understand how to enforce both for the same cell.



On Friday, January 08, 2010 1:14 PM Basil wrote:


You could just select the 'List' option and type Y,N in the criteria. It is
case sensitive.



"Lakeville" wrote:



On Friday, January 08, 2010 1:15 PM ryguy7272 wrote:


Data Valivation List Source = =$B$1:$B$2
In Cell B1, put Y and in Cell B2, put N


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Lakeville" wrote:



On Friday, January 08, 2010 1:15 PM T. Valko wrote:


Try this...

=FIND(A1,"~YN")1

Or, the robust version:

=FIND(A1,UPPER("~YN"))1

--
Biff
Microsoft Excel MVP



On Friday, January 08, 2010 1:24 PM Lakeville wrote:


I thought it was case sensitive, but it is not working that way for me.

"Basil" wrote:
You could just select the 'List' option and type Y,N in the criteria. It is
case sensitive.



On Friday, January 08, 2010 1:30 PM Lakeville wrote:


This is what I already have. If the user uses the drop down to select Y or N,
then it works properly. However, a user can manually enter lowercase y or n,
and I want to avoid that.

"ryguy7272" wrote:



On Friday, January 08, 2010 2:14 PM Basil wrote:


Strange. It would only stop them from entering the text once they navigate
away from the cell, and only if 'Show error alert after invalid data is
entered' is checked in the Error Alert tab of the Data Validation menu form.

Biff's solution should work too.

"Lakeville" wrote:



On Friday, January 08, 2010 11:46 PM Teethless mama wrote:


your formula fail. If user enter both YN in a cell


Try this one:

=AND(EXACT(A1,UPPER(A1)),OR(A1="Y",A1="N"))





"T. Valko" wrote:



On Saturday, January 09, 2010 12:27 AM T. Valko wrote:


Good catch. I did not test for that possibility.

Try this one:

=(LEN(A1)=1)*(FIND(A1,UPPER("YN")))

--
Biff
Microsoft Excel MVP






All times are GMT +1. The time now is 11:52 PM.

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