Formatting requirements/restrictions for data entered into cells (formatting masks)

HedyES

New Member
Joined
Jan 11, 2018
Messages
7
Hello,

I would like to restrict/require certain data in cells entered into to different columns as follows:

In column B the format needs to look like the following example: N1234 with the first character being an alpha value and the next four need to be numeric values

In column C the format needs to look lie the following example: AB1200 with the first two characters being alpha values and the next four need to be numeric values

I would prefer to use Data Validation instead of macros, but whatever works will be fine. I am working in Excel 2010

Thank you
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Cross posted https://www.excelforum.com/excel-fo...e-and-restrict-data-in-cells.html#post4966420

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Cross posted https://www.excelforum.com/excel-fo...e-and-restrict-data-in-cells.html#post4966420

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

Is there a way to delete this post?
 
Upvote 0
No need to delete this thread, all we ask is that you let people know that you have asked the same question elsewhere.
Also if you get a solution, please update this thread with the solution, so that we know that you are no longer in need of help.
 
Upvote 0
This is the solution for my original post:

Column B (starting with cell B21):
=AND(MEDIAN(CODE(LEFT(B21,1)),65,90=CODE(LEFT(B21,1))ISNUMBER(RGHT(B21,4)+0),LEN(B21)=5)

Column C (starting with cell C21):
=AND(MEDIAN(CODE(LEFT(C21,1)),65,90)=CODE(LEFT(C21,1)),MEDIAN(CODE(MID(C21,2,1)),65,90)=CODE(MID(C21,2,1)),ISNUMBER(RIGHT(C21,4)+0),LEN(C21=6)
 
Upvote 0
I posted the solution in case anyone needs this same information. How do I mark this post as solved?
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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