+ Reply to Thread
Results 1 to 6 of 6

checking a cell if it contains 6 characters

  1. #1
    Registered User
    Join Date
    11-12-2010
    Location
    Vancouver, WA
    MS-Off Ver
    Excel 2003
    Posts
    2

    checking a cell if it contains 6 characters

    i have a cell i have to check if it contains six characters. I have a list of data that i need to narrow down to six characters. I have successfully done that, but some of the cell has 5, 6, or 7 characters. The list contains about 600 cells, but i don't have time to format them individually. I want to create a formula that returns true or false if the cell contains 6 characters and false if it is above or below 6.

    Can somebody help me, i'm new to excel!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: checking a cell if it contains 6 characters

    Use another column with this formula & copy down

    =IF(LEN(A1)=6,"True","False")
    Last edited by royUK; 11-12-2010 at 02:56 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: checking a cell if it contains 6 characters

    Actually, the IF() is redundant. The test itself will return a TRUE/FALSE answer with just:

    =LEN(A1)=6
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    11-12-2010
    Location
    Vancouver, WA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: checking a cell if it contains 6 characters

    THANK YOU SO MUCH!!!

    i cant tell you how much i appreciate your help!

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: checking a cell if it contains 6 characters

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  6. #6
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: checking a cell if it contains 6 characters

    Just reading the OP's question, if you wanted to add characters to the front or cut off one of the characters this can be done too!

    =RIGHT(REPT("-",6) &RIGHT(B4,6),6)

    will pad with - or will give the right most 6 letters or just return the original if its 6 long


    =RIGHT(REPT("-",6) &LEFT(B4,6),6)

    will do the same but return the left most 6 charaters if it is above 7

    Just change the - after REPT to change the extra characters you want to add

    I may be wrong but it sounds like this might help!
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


+ 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