Enter specific formulated data - numbers & letters with dashes

dillpickle

New Member
Joined
Sep 15, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I am working on a shared spreadsheet for tracking and I need users to ONLY be able to enter a value that is LLNNNNN-NN (letters and numbers) and in another column (different data) LNNNNNNN-NN. Both are combos of letters and numbers but I need users to only be able to enter it in these ways.

For Example > Column D > AA12345-01
For Example > Column E > K1089383-03

We have asked numerous "experts" and nobody can seem to help us. HALP!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
how about
=AND(LEN(D2)=10,MID(D2,8,1)="-")

to excled symbols
=AND(LEN(D2)=10,MID(D2,8,1)="-",ISNUMBER(SUMPRODUCT(SEARCH(MID(D2,ROW(INDIRECT("1:"&LEN(D2))),1),"-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"))))

under data validation

for column D

it will allow any value to be used symbols etc - so that can be updated to something like
=ISNUMBER(SUMPRODUCT(SEARCH(MID(D2,ROW(INDIRECT("1:"&LEN(D2))),1),"-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")))
which allows - - but the AND only allows - in 1 place
i'll see and may add a new post
=AND(LEN(D2)=10,MID(D2,8,1)="-",ISNUMBER(SUMPRODUCT(SEARCH(MID(D2,ROW(INDIRECT("1:"&LEN(D2))),1),"-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"))))

But will allow a 2nd - anywhere - will work on that as well

but will data validation work
 
Last edited:
Upvote 0
ok, had another play
=AND(LEN(D2)=10,COUNT(FIND(MID(D2,SEQUENCE(LEN(D2)),1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))=9,MID(D2,8,1)="-")

Book4
ABCDEFGHI
1
2AB12345-01TRUETRUE
3
4TRUE
5=AND(LEN(D2)=10,COUNT(FIND(MID(D2,SEQUENCE(LEN(D2)),1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))=9,MID(D2,8,1)="-")
6For Example > Column D > AA12345-01
7For Example > Column E > K1089383-03
8
Sheet1
Cell Formulas
RangeFormula
F2F2=AND(LEN(D2)=10,MID(D2,8,1)="-",ISNUMBER(SUMPRODUCT(SEARCH(MID(D2,ROW(INDIRECT("1:"&LEN(D2))),1),"-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"))))
G2G2=ISNUMBER(SUMPRODUCT(SEARCH(MID(D2,ROW(INDIRECT("1:"&LEN(D2))),1),"-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")))
F4F4=AND(LEN(D2)=10,COUNT(FIND(MID(D2,SEQUENCE(LEN(D2)),1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))=9,MID(D2,8,1)="-")
Cells with Data Validation
CellAllowCriteria
D2Custom=AND(LEN(D2)=10,COUNT(FIND(MID(D2,SEQUENCE(LEN(D2)),1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))=9,MID(D2,8,1)="-")
 
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,983
Members
449,092
Latest member
Mr Hughes

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