Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Sep 2009
    Location
    India
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello Everyone,

    I have a designed a workbook to get the information about certain project. In this i have feild Project ID this field should contain 8-digit numeric value neither less nor large.
    For ex 12345678 if it is less than 8 digit than i want user to write it as 01234567.
    I tried validation by setting text lenght min = 8 and max = 8 it worked but it allows user to enter characters or alpha numeric values which i dont want.

    So can you help me out.

    Thanks
    Bharat

  2. #2
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use the validation formula of:

    =AND(MAX(LEN(A1))=8,MIN(LEN(A1))=8,ISNUMBER(A1*1))

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Set the Number format of the cell to Text.
    In the Data |Validation dialog, set Allow to Custom, then enter the following formula in the Formula box:

    =AND(LEN(A1)=8,NOT(ISERROR(VALUE(A1))))

    (this is for cell A1, replace A1 with the correct cell reference)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='mbarron' post='793879' date='18-Sep-2009 16:06']You can use the validation formula of:

    =AND(MAX(LEN(A1))=8,MIN(LEN(A1))=8,ISNUMBER(A1*1))[/quote]
    Max, I don't think that MAX and MIN will help here since we're working with a single cell.

  5. #5
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The Min and Max did not have an adverse effect, but are in fact unnecessry - which your solution also indicates. It can simplified to:
    =AND(LEN(A1)=8,ISNUMBER(A1*1))

  6. #6
    New Lounger
    Join Date
    Sep 2009
    Location
    India
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='mbarron' post='793879' date='18-Sep-2009 19:36']You can use the validation formula of:

    =AND(MAX(LEN(A1))=8,MIN(LEN(A1))=8,ISNUMBER(A1*1))[/quote]

    Thanks a lot. It worked for me.

Posting Permissions

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