Data Validation

Hazeyt

New Member
Joined
Jan 23, 2023
Messages
29
Office Version
  1. 365
Please can someone help with Data Validation.

I want it to be 8 digits only.

1st digit must be a T

The rest are numbers but the last digit may be a number or letter.

Many thanks
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
try this:
1677590230411.png
 
Upvote 0
A, for me personally, fun option:

Excel Formula:
=NOT(ISERROR(FILTERXML("<t><s>"&A1&"</s></t>","//s[starts-with(.,'T')][string-length()=8][substring(.,2,6)*0=0][translate(substring(., 8), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789','')='']")))

It's behaving as some pattern check in an anding way:
  • [starts-with(.,'T')] - Check that the input starts with an uppercase T (xpath is case sensititve);
  • [string-length()=8] - Check that the input is 8 characters long;
  • [substring(.,2,6)*0=0] - Check that the character from index 2 upto 7 are digits;
  • [translate(substring(., 8), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789','')=''] - Check that the 8th character is equal to any uppercase letter or a digit.
 
Upvote 0
I guess fun, like beauty, is in the eye of the beholder. ;)
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,737
Members
449,050
Latest member
excelknuckles

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