+ Reply to Thread
Results 1 to 3 of 3

Data Validation for first part of Text string

  1. #1
    Registered User
    Join Date
    09-20-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Data Validation for first part of Text string

    Hi

    I am being provided with a spreadsheet containing among many things, a long list of names.

    I need a data validation formula to control the way this data is entered into the spreadsheet. The names must be entered like this: J Armstrong . So I need a rule that says the first 3 characters must be Upper Case/Space/ Upper Case. There is no restriction on the number of characters.

    I have seen how something like =AND(CODE(LEFT(Y12,1))>=65,CODE(LEFT(Y12,1))<=90) will ensure the first letter is upper case, but I cannot get the other conditions to combine in the one formula successfully.

    Could anyone help on this please?

    Thanks

    Eoin Joyce

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Data Validation for first part of Text string

    How about

    =(AND(UPPER(LEFT(A1,3)=LEFT(A1,3),MID(A1,2)="")

    Update: This prob wont work if non alphabet chars are entered
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Data Validation for first part of Text string

    hi Eoin Joyce, try:
    =AND(CODE(LEFT(Y12,1))>=65,CODE(LEFT(Y12,1))<=90,MID(Y12,2,1)=" ",CODE(MID(Y12,3,1))>=65,CODE(MID(Y12,3,1))<=90)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1