Data Validaiton formula containing numbers and text

madams_08

New Member
Joined
Jun 18, 2012
Messages
8
I read a previous article and non of the formulas worked for my worksheet.

I need to validate a cell for the following custom format, but cant get it to work:

1. XX00000
2. 00000000XX
3. 000000X

Where XX is any combination of letters (upper or lowercase) and
00000 is a combination of any 5 numbers.

All of these formaulas can not allow special characters.

It must always be in this format, with this number of digits in total on each
 
I do manually enter the data.. and I still get a error message
Yes, you should get the error message since those entries aren't valid.

00000000XX = 8 digits followed by 2 letters

This data validation formula:

=AND(LEN(A2)=10,ABS(CODE(UPPER(MID(A2,9,1)))-77.5)<13,ABS(CODE(UPPER(MID(A2,10,1)))-77.5)<13,COUNT(-MID(A2,ROW(INDIRECT("1:8")),1))=8)

Will only allow entries that start with 8 digits (from 0 - 9) followed by 2 letters (A - Z, any case).

12345678y = 8 digits followed by 1 letter = invalid entry
87654321d = 8 digits followed by 1 letter = invalid entry
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
what would the equation be for 8 digits and 1 letter
Try this...

=AND(LEN(A2)=9,ABS(CODE(UPPER(RIGHT(A2)))-77.5)<13,COUNT(-MID(A2,ROW(INDIRECT("1:8")),1))=8)

If you test the formula on the worksheet it must be array entered.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top