Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Showing Month Abbreviation With Using 2 Characters

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    3
    Rep Power
    0

    Showing Month Abbreviation With Using 2 Characters

    I work in a factory where we use 2 letter month expiry abbreviations. I'm trying to get Excel to show it the same way, but it's limited to Jan, 01, January, etc.
    Is there a way I can get it to show JA instead?
    We have a spreadsheet that autopopulates a 6 month and 9 month expiration from the current date.
    IE 01/12/2013 turns into =M1800+180 (2014/May/30) and =M1800+270 (2014/Aug/28)
    So I can't just write a choose/if formula. I'm not sure there's any way of doing this, any help would be appreciated.
    (I've attached a copy of an example as well)
    Attached Files Attached Files

  2. #2
    Member
    Join Date
    May 2013
    Posts
    31
    Rep Power
    0
    Welcome to the forum!

    You can use strings. In B1:
    =YEAR(A1+180)&"/"&UPPER(LEFT(TEXT(A1+180,"mmm"),2))&"/"&DAY(A1+180)

  3. #3
    Junior Member
    Join Date
    Jul 2013
    Posts
    3
    Rep Power
    0
    Thanks! This is great, other than it's showing MA for both March and May, JU for June and July etc. I guess that's an issue since we're just cutting off anything past the 2nd letter. These are the abbreviations we use:
    January: JA
    February: FE
    March: MR
    April: AL
    May: MA
    June: JN
    July: JL
    August: AU
    September: SE
    October: OC
    November: NO
    December: DE
    I'm sure this makes everything way more complicated.

  4. #4
    Member
    Join Date
    May 2013
    Posts
    31
    Rep Power
    0
    Right, which is why 3 characters are used for abbreviations for month names. If you don't mind using a UDF, what you want can be done and simplified.

  5. #5
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    12
    make your own customlist:

    Code:
    Sub M_snb()
      Application.AddCustomList Split("MA|FE|MR|AL|MA|JN|JL|AU|SE|OC|NO|DE","|")
    End Sub

  6. #6
    Member
    Join Date
    May 2013
    Posts
    31
    Rep Power
    0
    For the UDF method, add this to a Module and use it as the comment demonstrates.
    Code:
    ' =Month2(A1+180)
    Function Month2(aDate As Date) As String
      Dim d() As String
      Application.Volatile False
      d() = Split("JA FE MR AL MA JN JL AU SE OC NO DE")
      Month2 = Year(aDate) & "/" & d(Month(aDate) - 1) & "/" & Day(aDate)
    End Function

  7. #7
    Junior Member
    Join Date
    Dec 2012
    Posts
    16
    Rep Power
    0
    HI
    Maybe try incorporating the LOOKUP function.

    =LOOKUP(MONTH(A1+180),{1,2,3,4,5,6,7,8,9,10,11,12} ,{"JA","FE","MR","AL","MA","JN","JL","AU","SE","OC ","NO","DE"})

    Alternatively the VLOOKUP can be used as well.

  8. #8
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    659
    Rep Power
    13
    You can format your cells as General and then put this formula in B1 and copy it down...

    =REPLACE(UPPER(TEXT(A1+180,"yyyy/mmm/d")),6,3,CHOOSE(MONTH(A1+180),"JA","FE","MR","AL","MA","JN","JL","AU","SE","OC ","NO","DE"))

    Change the two 180's to 270's in the above formula and use it in cell C1.

  9. #9
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    12
    or
    =TEXT(A1+180,"yyyy/") & MID("JAFEMRALMAJNJLAUSEOCNODE",2*MONTH(A1+180)-1,2) & "/" &TEXT(A1+180,"dd")

  10. #10
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    659
    Rep Power
    13
    Quote Originally Posted by snb View Post
    or
    =TEXT(A1+180,"yyyy/") & MID("JAFEMRALMAJNJLAUSEOCNODE",2*MONTH(A1+180)-1,2) & "/" &TEXT(A1+180,"dd")
    Yes, using MID that way is a good idea. You can save a coupe of characters (and a concatenation) by moving the last slash into the last TEXT function call like this...

    =TEXT(A1+180,"yyyy/") & MID("JAFEMRALMAJNJLAUSEOCNODE",2*MONTH(A1+180)-1,2) & TEXT(A1+180,"\/dd")

Similar Threads

  1. Custom Charts in Excel :: Comparison RAG Chart Showing Tolerance Limits
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 06-13-2013, 09:40 PM
  2. Find Mismatch Characters:
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 0
    Last Post: 06-06-2013, 07:53 PM
  3. Extract Certain Characters From A Text String
    By bobkap in forum Excel Help
    Replies: 5
    Last Post: 05-24-2013, 06:25 AM
  4. Excel Chart Showing Values on Angle: Nightingale Chart
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 0
    Last Post: 10-17-2012, 06:39 PM
  5. Remove Special Characters :
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 3
    Last Post: 03-06-2012, 09:41 PM

Posting Permissions

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