+ Reply to Thread
Results 1 to 6 of 6

custom format with text and numbers

  1. #1
    Registered User
    Join Date
    11-05-2013
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2003
    Posts
    56

    custom format with text and numbers

    This is probably simple, but I suck at custom formats.

    I want a cell to display

    A-12345

    I want one character of text, followed by a dash, followed by 5 digits

    so the person entering data only has to type

    A12345

    Bonus points if the letter character can be capitalized.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: custom format with text and numbers

    Custom formats only really work on numbers. You can use a custom format of:

    "A-"00000

    so that if your workers enter 12345 it will be displayed as A-12345, and 987 will be displayed as A-00987.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    11-05-2013
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: custom format with text and numbers

    I see

    No, the letter would have to be changeable. Was hoping this could be done as a time saver. Is there a formula that would work? Maybe using "TEXT"?

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: custom format with text and numbers

    If you enter a letter followed by digits then it is a text value that you are entering - the TEXT function won't work on that, either.

    However, if you don't mind the result that you want being in a different cell, then if you enter a12345 into cell A1, for example, then you could have this formula in B1:

    =IF(A1="","",UPPER(LEFT(A1))"&"-"&RIGHT(A1,LEN(A1)-1))

    and that will give you A-12345.

    Hope this helps.

    Pete

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,913

    Re: custom format with text and numbers

    =left(a1,1)&"-"&right(a1,len(a1)-1)
    or
    =substitute(a1,left(a1,1),left(a1,1)&"-")
    try this
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Registered User
    Join Date
    11-05-2013
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: custom format with text and numbers

    Thanks! I guess the only way to do this is to have it display in another cell.

    I used:

    =LEFT(A4,1)&"-"&RIGHT(A4,5)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Custom Format Issue with Numbers
    By pdias2 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-20-2014, 01:57 PM
  2. [SOLVED] Convert all numbers stored as text or custom formatted to numbers &no decimals - 40 sheets
    By synses in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2013, 01:46 AM
  3. [SOLVED] Merging Numbers with custom format - how to keep format
    By oddcarout in forum Excel General
    Replies: 3
    Last Post: 08-15-2012, 07:54 PM
  4. [SOLVED] Custom Format for Numbers
    By Dr. Sachin Wagh in forum Excel General
    Replies: 4
    Last Post: 01-14-2006, 01:50 AM
  5. [SOLVED] How to format text and numbers as custom
    By Julian Ganoudis in forum Excel General
    Replies: 4
    Last Post: 04-04-2005, 02:06 PM

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