+ Reply to Thread
Results 1 to 6 of 6

Custom Date format to comply with Canadian Food Regulations

  1. #1
    Registered User
    Join Date
    11-17-2015
    Location
    Canada
    MS-Off Ver
    ms excel 2007
    Posts
    3

    Custom Date format to comply with Canadian Food Regulations

    I hope that this is in the right forum.

    I need to be able to convert dates from excel native format to the following (yy mm dd):

    08 JA 30 is 2008 January 30th
    15 AL 24 is 2015 April 24th


    Where the month letters are as follows:
    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 have searched for an answer to this but have not been able to find an answer. The weird thing is that this format is the law in Canada for food labeling but no one seems to have ever enquired how to do it.

    Can anyone help me?

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,659

    Re: Custom Date format to comply with Canadian Food Regulations

    With A1 is short date in text

    =DATE(20&LEFT(A1,2),LOOKUP(MID(A1,4,2),{"AL","AU","DE","FE","JA","JN","JL","MA","MR","NO","OC","SE"},{4,8,12,2,1,6,7,5,3,11,10,9}),RIGHT(A1,2))

    Note: This about converting 08 JA 30 to 30 JAN 2008 (if you are interresting in)
    Last edited by bebo021999; 11-17-2015 at 09:11 PM.
    Quang PT

  3. #3
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Custom Date format to comply with Canadian Food Regulations

    How about this formula:
    Please Login or Register  to view this content.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  4. #4
    Registered User
    Join Date
    11-17-2015
    Location
    Canada
    MS-Off Ver
    ms excel 2007
    Posts
    3

    Re: Custom Date format to comply with Canadian Food Regulations

    IT WORKS!!!!!
    =TEXT(A1,"yy")&" " &CHOOSE(MONTH(A1),"JA","FE","MR","AL","MA","JN","JL","AU","SE","OC","NO","DE")&" "&DAY(A1)

    Thank You !!!!!
    I think this will help many people in the future!!!!!

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,460

    Re: Custom Date format to comply with Canadian Food Regulations

    I don't know if it really applies to what you are doing, but one thing I would point out about Pierre's formula -- it converts a regular date serial number into a text string, which will not be easily used in other calculations. I would recommend that this sort of formula be used as a "dead end" type of thing. If you need this result to be used in other date/time calculations, keep a "copy" of the cell in regular Excel date/time format.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Registered User
    Join Date
    11-17-2015
    Location
    Canada
    MS-Off Ver
    ms excel 2007
    Posts
    3

    Re: Custom Date format to comply with Canadian Food Regulations

    Thanks for the follow up.

    Indeed there will be no further calculations. An external program will take the text contents of the cell and use it to print the date.

    Again, many
    Thanks

+ 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. Format Canadian Postal Code on Entry
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 03-24-2019, 04:20 PM
  2. Canadian Postal Code format
    By nmurphy2 in forum Office 365
    Replies: 4
    Last Post: 10-02-2014, 01:01 AM
  3. [SOLVED] How to Sum Cells that comply with a date(month and year) and account ID
    By czhl1 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-24-2013, 06:45 PM
  4. [SOLVED] Format for Canadian Postal Codes
    By rmcc in forum Excel General
    Replies: 25
    Last Post: 07-24-2012, 02:04 PM
  5. Have top rows not comply to column width format?
    By Orlic in forum Excel General
    Replies: 1
    Last Post: 01-11-2008, 03:43 PM
  6. Custom Date Format
    By windme in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-06-2007, 10:21 AM
  7. [SOLVED] SOX Regulations
    By Lp12 in forum Excel General
    Replies: 1
    Last Post: 03-19-2006, 06:10 AM

Tags for this Thread

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