+ Reply to Thread
Results 1 to 6 of 6

Formula for validating text in cell with pattern of numbers and letters

  1. #1
    Registered User
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    8

    Formula for validating text in cell with pattern of numbers and letters

    Hi,

    I am looking out for a excel formula that helps me to find out the cells that has first four characters as numbers and next two characters as letters. Eg - 1234AB. I have a list in column A that has only letters and only numbers and alphanumeric cells and a few cells in the above format of 1234AB etc. I want a formula that identify such cells out of the list. Can anyone help please?
    Last edited by sweetusmile; 07-17-2012 at 11:39 AM.

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

    Re: Formula for validating text in cell with pattern of numbers and letters

    Try

    =AND(LEFT(A1,4)>999,ISERR(RIGHT(A1,2)+0))*1

    and copy down the column

    Cells containing 1 conform to your "1234AB" format
    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
    Registered User
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Formula for validating text in cell with pattern of numbers and letters

    Special K -

    Thanks for your formula. However, it does not give me the expected results. It shows all the cells that are only alphabets and only numbers along with the alphanumeric cell in the format 1234AB

    I have attached my excel sheet where i have put a formula in column C to show me only the cells that has "_NEW" to it. I have used your formula in column B, but does not seem working. Can you please have a look at the excel and let me know the suitable formula to identify only the cells in the format 1234AB

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formula for validating text in cell with pattern of numbers and letters

    Perhaps...

    =AND(LEN(A2)=6,ISNUMBER(LEFT(A2,4)*1),ISERROR(RIGHT(A2,2)+0)*1)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Formula for validating text in cell with pattern of numbers and letters

    Try this,

    =(COUNT(MID(A2,{1,2,3,4},1)+0)=4)*(COUNT(SEARCH(MID(A2,{5,6},{1,100}),"ABCDEFGHIJKLMNOPQRSTUVWXYZ"))=2)

    1 means OK, 0 Not OK
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  6. #6
    Registered User
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Formula for validating text in cell with pattern of numbers and letters

    Thanks a ton Ace_XL and Haseeb A for solving my query. The formulae really did help me a lot.

    Thanks once again!

+ 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