Controlling a cells format - Alpha Numeric (x4) Alpha Alpha

Dobbsylondon

New Member
Joined
Oct 21, 2014
Messages
6
Good day all,

First post, never lurked.

I'm confident you guys are the ones to ask though.
In an existing sheet, I'd like to control the format of cells in a column. Namely restrict it to ANNNNAA (A=Text and N=numbers), 7 characters maximum as it's really meant to accept only existing unique ID numbers.

I've tried to use \####\\ or "",####"","" which may or may not obviously work as a custom. As my understanding is at it's limit, I thought it time to ask for some help.


Thank you all in advance and I hope to repay the favour at some point.

Kind regards
 
Would I change A1 to (in the case of my sheet) B:B to apply it to the whole B column?
The formula I posted was missing some $ signs to make the ranges absolute so that when applied against multiple cells, they would remain constant (the formula below is now correct). Select the whole column, if that is how many cells you think will ultimately need this validation rule (if you select a smaller range, make sure to start with B1 to match the cell reference in the formula), then call up the Data Validation dialog box, select Custom from the Allow drop down and put the following formula in the Formula field...

=IF(LEN(B1)=7,AND(IF(MID("A0000AA",ROW($1:$7),1)="A",(MID(B1,ROW($1:$7),1)>="A")*(MID(B1,ROW($1:$7),1)<="Z"),ISNUMBER(-MID(B1,ROW($1:$7),1)))))
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Perhaps
=ISNUMBER(MID(B1,2,4) / (LEN(B1)=7)/(0=SUMPRODUCT(--EXACT(UPPER(MID(B1,{1,6,7},1)),LOWER(MID(B1,{1,6,7},1))))))
 
Last edited:
Upvote 0
Perhaps
=ISNUMBER(MID(B1,2,4) / (LEN(B1)=7)/(0=SUMPRODUCT(--EXACT(UPPER(MID(B1,{1,6,7},1)),LOWER(MID(B1,{1,6,7},1))))))
You cannot use that in the Data Validation that I think the OP wants to use because of the array constants.
 
Upvote 0
Arrayformula:

Code:
=SUM(--ISNUMBER(--MID(B1;ROW(2:5);1));--ISNUMBER(--MID(B1;ROW(6:7);1));--ISNUMBER(--LEFT(B1;1)))=4
 
Upvote 0
Arrayformula:

Code:
=SUM(--ISNUMBER(--MID(B1;ROW(2:5);1));--ISNUMBER(--MID(B1;ROW(6:7);1));--ISNUMBER(--LEFT(B1;1)))=4
@snb,

You need to patch this formula so that it will not accept values like A123E4CD, A1X123CD, A1234ABCDEF, etc.


@Dobbsylondon,

Still checking... did you see Message #21 yet?
 
Upvote 0
Not that complicated:

Code:
=SUM(--ISNUMBER(--MID(B1;ROW(2:5);1));--ISNUMBER(--MID(B1;ROW(6:7);1));--ISNUMBER(--LEFT(B1;1));LEN(B1))=11
 
Upvote 0

Forum statistics

Threads
1,215,578
Messages
6,125,642
Members
449,245
Latest member
PatrickL

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