+ Reply to Thread
Results 1 to 3 of 3

Checking pattern in cells

  1. #1
    Registered User
    Join Date
    08-29-2012
    Location
    called rsboote
    MS-Off Ver
    Excel 2003
    Posts
    2

    Checking pattern in cells

    Hello all

    I have a column which has combination of texts and numbers. I would like to check it and see if the cells are in the A9A9A9 pattern (A- letters & 9 - for numbers) and in the length of 6.

    How can I check its pattern? Is there a function I could use?

    Please help!

    Thanks and appreciate your help in advance
    Balburam

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Checking pattern in cells

    Hi Balburam,

    You could use a function like this to check each digit/character:

    =AND(LEN(A1)=6,LEFT(A1,1)>="A",LEFT(A1,1)<="Z",MID(A1,2,1)+0>=0,MID(A1,2,1)+0<=9,MID(A1,3,1)>="A",MID(A1,3,1)<="Z",MID(A1,4,1)+0>=0,MID(A1,4,1)+0<=9,MID(A1,5,1)>="A",MID(A1,5,1)<="Z",MID(A1,6,1)+0>=0,MID(A1,6,1)+0<=9)

    If any of the tests fail, the result will be FALSE (or #VALUE error).

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Checking pattern in cells

    Maybe

    =AND(LEN(A2)=6,COUNT(MID(A2,{1,3,5},1)*1)=0,COUNT(MID(A2,{2,4,6},1)*1)=3)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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