+ Reply to Thread
Results 1 to 16 of 16

Custom number format with text

  1. #1
    Forum Contributor
    Join Date
    12-21-2004
    Location
    MN
    MS-Off Ver
    Microsoft 365
    Posts
    211

    Custom number format with text

    Is there a way to have a format on a cell that would allow for:

    3 Characters - 6 numbers?

    What I need is something like NEW-001266. But the numbers and letters will always change. It may be PEO-001610, or HUT-00200, etc.

    I can get it if the characters don't changes.
    Thanks!
    Last edited by karstens; 01-18-2011 at 12:30 PM.

  2. #2
    Registered User
    Join Date
    10-05-2010
    Location
    S.A
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Custom number format with text

    hi
    you can restrict length of text if you go to data validation
    in settings, you select option text length, then equla to
    number of characters you want in a cell.
    by this way, you can't enter more or less characters specified.
    hopefull that's what you are looking for

  3. #3
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Custom number format with text

    newb formula of the day

    say you are inputing into cell b1...use data validation, custom formula

    Please Login or Register  to view this content.
    drag down
    Last edited by TechRetard; 01-14-2011 at 08:50 PM.

  4. #4
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: Custom number format with text

    A modification to the above formula

    Please Login or Register  to view this content.
    Copy + Past special to copy

    Regards

  5. #5
    Forum Contributor
    Join Date
    12-21-2004
    Location
    MN
    MS-Off Ver
    Microsoft 365
    Posts
    211

    Re: Custom number format with text

    I tried the suggestion in the B1 cell, and also the suggestion in the F8 cell. I copied the formula into the custom validation window, but both formulas bring up a dialog box that says this will result in an error.
    I am not sure what I am doing wrong.
    Thank you for the suggestions.

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Custom number format with text

    Quote Originally Posted by karstens View Post
    Is there a way to have a format on a cell that would allow for:

    3 Characters - 6 numbers?

    I don't quite understand what you need.
    Do you want to enter a continuous string in a cell so that it formats as needed on exit?
    Should that be in the same cell or is another one OK?

  7. #7
    Forum Contributor
    Join Date
    12-21-2004
    Location
    MN
    MS-Off Ver
    Microsoft 365
    Posts
    211

    Re: Custom number format with text

    I am trying to create an input form where managers have to enter their project detail. It is important that they always enter the same format. Our projects are three letters that represent the company, a dash, and a 6 digit assigned project code. So one may be NEW-001266. Another company may be PEO-012279.

    I wanted to format the cell, so it required them to always follow the correct format. I could use custom number formatting by using "NEW-"####. but that only works for the "NEW" company and all companies will use the same form.

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Custom number format with text

    Try this
    Data Validation > Custom
    Formula:=
    Please Login or Register  to view this content.

    Hope this helps

    [EDIT]
    Attachment corrected and Formula further defined
    Attached Files Attached Files
    Last edited by Marcol; 01-18-2011 at 12:09 PM. Reason: Attachment temporarily removed, now replaced
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  9. #9
    Forum Contributor
    Join Date
    12-21-2004
    Location
    MN
    MS-Off Ver
    Microsoft 365
    Posts
    211

    Re: Custom number format with text

    Quote Originally Posted by Marcol View Post
    Try this
    Data Validation > Custom
    Formula:=
    Please Login or Register  to view this content.

    Hope this helps

    Thank you for the suggestion. When I use this, it still allows me to put other data in there that is not formated. So I could just type NEW in there and it would not error off, which is what I would have thought data validation should do in this case.

    If users are not forced to enter all three letters, AND all 6 numbers, we will always be sending the form back to them to enter it correctly.

    Maybe I was doing something wrong that it allows incorrect formats to be entered.
    Thanks again for your help.

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Custom number format with text

    My mistake posted wrong attachment give me 5-10 mins

  11. #11
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Custom number format with text

    Try Post #8 again, it should work better now.

    Sorry about that

  12. #12
    Forum Contributor
    Join Date
    12-21-2004
    Location
    MN
    MS-Off Ver
    Microsoft 365
    Posts
    211

    Re: Custom number format with text

    Sorry so sound dumb, but when I go reopen #8 it does the same thing. Not sure what I need to do.

  13. #13
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Custom number format with text

    Have you down-loaded the attachment?

    It seems okay to me, the validation is only in Cells A2 to A19.

    Hmm?
    Down-loaded it again and the refs seem to have changed....

    Try this attachment
    Attached Files Attached Files
    Last edited by Marcol; 01-18-2011 at 12:27 PM.

  14. #14
    Forum Contributor
    Join Date
    12-21-2004
    Location
    MN
    MS-Off Ver
    Microsoft 365
    Posts
    211

    Re: Custom number format with text

    I go back up to post #8
    Click on karstens_Book1.xls
    It opens in excel, shows A2:A19 with the data validation in it, but it is the exact same as the first time when you said it wasn't working.
    I can click in any of those cells and type incorrect data.
    I tried to restart my computer, thinking it was still opening your first version of the excel document. It is like I am not getting the updated version.

  15. #15
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Custom number format with text

    Try Post #13

  16. #16
    Forum Contributor
    Join Date
    12-21-2004
    Location
    MN
    MS-Off Ver
    Microsoft 365
    Posts
    211

    Re: Custom number format with text

    AH! There it is! AND it works! Sorry about that! Thank you very much for your help!

+ 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