+ Reply to Thread
Results 1 to 7 of 7

How to custom format a text

  1. #1
    Registered User
    Join Date
    05-24-2019
    Location
    USA
    MS-Off Ver
    MS Office Professional Plus
    Posts
    33

    How to custom format a text

    I want to enter a date in a cell as mm/yy where the slash "/" always populates automatically. How do I do this? The problems I'm facing are:

    1) if I choose 00/00 or ##/## in Custom it converts my date into another fraction or decimal.
    2) there's no option for a "mm/yy" under Date
    3) the cell is currently a Text, which also has no customization option (ie., when entering the date you have to manually type "/").

    Thanks so much!

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How to custom format a text

    You can use Custom mm/yy to format a date as mm/yy but it still has to be inputted in a way that Excel recognizes it as a date.

    You will have to type in a slash or a hyphen between the month number and the year.

  3. #3
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: How to custom format a text

    You could use a Custom Format of 00\/00. However, this will not be treated as a date.
    If someone helped achieve your solution, consider clicking "* Add Reputation" on their post.

    If your question has been answered, mark the thread as [SOLVED] using the Thread Tools menu at the top of the thread.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,826

    Re: How to custom format a text

    If you enter a legitimate date serial number, then "mm/yy" should be a perfectly valid custom number/date format.

    https://support.office.com/en-us/art...7-9c9354dd99f5
    https://support.office.com/en-us/art...rs=en-US&ad=US

    You are correct -- as text, you cannot use number formatting to change the display of the entered text. You can always use Excel's text manipulation functions to change the text string. If you enter '0119 in a cell, an adjacent cell could have a formula like =LEFT(cell,2)&"/"&RIGHT(cell,2) to insert a / in the middle of the text string.

    A lot depends on exactly how you intend to use this -- what do you want to enter for data entry, what do you need the output to be, what are you going to use the output for, and so on.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    05-24-2019
    Location
    USA
    MS-Off Ver
    MS Office Professional Plus
    Posts
    33

    Re: How to custom format a text

    I'll expand more on what I'm trying to accomplish. I'm having a cell to input the date. The final format of the date will be mmyy, in a text format, because I need to be able to search for that number (mmyy) in a larger string of numbers. Currently I have it set up as follows:

    Input (cell is Text): 00/00
    Next cell (hidden): removes the 3rd character or /
    Next cell (hidden): searches for 0000

    I was hoping to automate the / so it is always the 3rd character that gets removed. If the user types the / then everything is A-OK. However, if the user inputs the date as 0000, my calculation gets messed up.

    I've tried using the mm/yy option under Custom, but when I type in for example 0321 (in an attempt to get 03/21, it comes out as 11/00 (or 11/16/1900)

    I've also tried 00\/00 as someone suggested. It works well if you type the number without any slash. But if the user types the slash, again it gets messed up. I'd like the option to do either.


    This is much like any online form that you might fill out on the internet, such as a credit card expiration, that automatically populate the /. I didn't know it would be this complicated.
    Last edited by bigscientist; 05-28-2019 at 07:30 PM.

  6. #6
    Registered User
    Join Date
    05-24-2019
    Location
    USA
    MS-Off Ver
    MS Office Professional Plus
    Posts
    33

    Re: How to custom format a text

    Ok I figured out what to do but I need help to pull it off.

    In a hidden cell, what would be the formula to search for "/" and if it's present then delete it? That should work.

  7. #7
    Registered User
    Join Date
    05-24-2019
    Location
    USA
    MS-Off Ver
    MS Office Professional Plus
    Posts
    33

    Re: How to custom format a text

    SOLVED: used =SUBSTITUTE

+ 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 to text same as custom format
    By selim69 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-21-2018, 08:12 AM
  2. [SOLVED] Custom cell format - text with text
    By Mechjo16 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2017, 05:02 PM
  3. Help with custom text format
    By stephme55 in forum Excel General
    Replies: 3
    Last Post: 06-23-2016, 03:34 PM
  4. Change format from custom to text
    By luke.guthrie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2012, 03:34 PM
  5. Custom format with text
    By PierreL in forum Excel General
    Replies: 2
    Last Post: 10-14-2005, 02:05 PM
  6. Custom format text
    By coco in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2005, 01:05 PM
  7. Custom Format text XX:XXXX:XX
    By mustard in forum Excel General
    Replies: 2
    Last Post: 02-18-2005, 03:04 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