+ Reply to Thread
Results 1 to 17 of 17

Change Date from "DD.MM.YYYY" to "MM.YYYY"

  1. #1
    Registered User
    Join Date
    05-23-2024
    Location
    Mannheim, Germany
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Change Date from "DD.MM.YYYY" to "MM.YYYY"

    Dear Members,

    I have the following problem in EXCEL. I have two lists of data, both as a time-series, meaning the data within the list is linked to a date. I now want to match some Data of the two lists by using XLOOKUP and the Date. The problem is, that it is monthly data but the date for the same data is different (for January 1965 I have 31.01.1965 and 30.01.1965). Therefore, XLOOKUP does not work. I already tried quite a lot of different approaches but none of them converted the two Dates into identical monthy dates so I could apply XLOOKUP.
    Does anyone know how to convert these different Dates into the same "Value"/monthly dates? The final format of the date is not important, whether it is "January 1965", "01-1965", "1965-01" or something else.

    Thank you all very much in advance.

    Sincerely
    Dennis
    Attached Files Attached Files
    Last edited by DennisKuechle; 05-23-2024 at 09:16 AM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,111

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    A sample sheet would help here, and possibly will enable a quicker and more accurate solution for you.


    The forum does allow for spreadsheets to be uploaded direct to the forum -

    Please see the Yellow Banner at the top of the page explaining how to attach a sample spreadsheet

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.


    Here are the instructions, found at the top of the page again
    HOW TO ATTACH YOUR SAMPLE WORKBOOK:, Fast answers need clear examples. Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated Expected results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    05-23-2024
    Location
    Mannheim, Germany
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    Thank you for the fast reply.

    In the sample sheet, you can see the two different Sheets I used for distinguishing between the data.

    I already tried to edit the date, but changing the format of the cell only changed the look but not the intrinsic value of the date.

    I hope this helps.

    If there is any need for further clarification by my side, please let me know.

    Thank you very much

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,111

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    dates are just numbers starting jan-1900 and 1 added for each day
    so
    the number for 31/1/1965 is 23773
    change to general and you will see the numbers
    30/1/1965 is 1 less 23772

    So changing the format , as you say, just changes the way it looks

    so using xlookup - what are your expected results and why

    cannot see what you are doing on the sample
    I now want to match some Data of the two lists by using XLOOKUP and the Date.
    link to do what

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    You can make XLOOKUP work WITHOUT changing your date formats.

    =XLOOKUP(TEXT(B2,"mm/yyyy"),TEXT(Data2!$B$2:$B$13,"mm/yyyy"),Data2!$A$2:$A$13)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    05-23-2024
    Location
    Mannheim, Germany
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    The data I am working with consists of several companies and company specific return. The data for every company ranges from 1970-2006. I now want to match the company data "LOGMB" from the first sheet with the date from the other Sheet. To do so, I need a "unique identifier", otherwise, X-Lookup would not work since the date repeats itself several times. My idea was to combine the Numbers from the "Permno"-Column with the date (=A1&A2) to create this unique identifier in both sheets and use it then to correctly match LOGMB to the correct date&permno in the other sheet.
    But to make the unique identifiers identical in both sheets, the date has to have the same intrinsic value. This is why I am trying to reduce the date to month and year to make them similar in both sheets.
    I hope this helps explaining my situation.

    Thank you
    Attached Files Attached Files

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    You have attached the same workbook again - why? Where are your expected results? If they are noit there, mock them up, please. SHOW me what you want.

    Please add the Excel product (365) to your forum profile.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    One more guess. On Data2 in D2 copied down:

    =XLOOKUP(A2&TEXT(B2,"mm/yyyy"),Data1!$A$2:$A$15&TEXT(Data1!$B$2:$B$15,"mm/yyyy"),Data1!$C$2:$C$15)
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-23-2024
    Location
    Mannheim, Germany
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    I adjusted the workbook.
    As you can see in Sheet 2, I want to use the unique identifier to enable XLOOKUP. This does not work since the dates sometimes differ (31.01 vs 30.1). That is why I want to only have the month and the year as "intrinsic value" for the date-cell to make the unique identifiers equal in both sheets.
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    I asked for you to mock up expected results, not use a non-functioning formula.

    Once again, this in D2 copied down should do what you want:

    =XLOOKUP(A2&TEXT(B2,"mm/yyyy"),Data1!$A$2:$A$15&TEXT(Data1!$B$2:$B$15,"mm/yyyy"),Data1!$C$2:$C$15)

    See the attachment to my previous post.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    Here it is in your second workbook.

    But to make the unique identifiers identical in both sheets, the date has to have the same intrinsic value. This is why I am trying to reduce the date to month and year to make them similar in both sheets.
    You do not need a unique identifier with my formula. The formula deals with the dates by using just the month and year. I think that you are not understanding how my formula works.
    Attached Files Attached Files
    Last edited by AliGW; 05-23-2024 at 09:59 AM.

  12. #12
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    Or try:

    =XLOOKUP(A2&EOMONTH(B2,0),Data1!$A$2:$A$15&Data1!$B$2:$B$15,Data1!$C$2:$C$15)

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    Are we there yet, Dennis?

    Please add 365 to your forum profile, as requested earlier.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    Marked as solved, but no reply. A 'thank you' might have been nice.

  15. #15
    Registered User
    Join Date
    05-23-2024
    Location
    Mannheim, Germany
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    Sorry, I am currently in a hurry.

    Thank you all very much for your help.
    It is greatly appreciated.

    Sincerley
    Dennis Küchle

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    You're welcome. But you still haven't updated your profile - please do this as soon as you can.

    You should never be in too much of a hurry to acknowledge help.

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Change Date from "DD.MM.YYYY" to "MM.YYYY"

    Thanks for updating your profile.

+ 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. [SOLVED] Make "WeekdayName" Function Work With "dd/mm/yyyy" Format
    By KMVKMVKMV in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-30-2019, 02:30 PM
  2. Replace date in "DD.MM.YYYY" with date "DD/MM/YYYY" format as soon as user hits enter
    By abhinavbinkar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2019, 09:12 AM
  3. Difference between "mm/dd/yyyy" vs "mm/dd/yyyy;@" formatting
    By lostest in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-13-2016, 03:39 PM
  4. [SOLVED] VBA Get the Date Format Change As "MM-DD-YYYY" In Range
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2014, 10:37 AM
  5. [SOLVED] Convert from "general" (YYYYMMDD) to specific "custom" format (YYYY.MM.DD)
    By Ella_p in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2013, 02:23 AM
  6. [SOLVED] Function to change date from the form "20120803" to mm-dd-yyyy
    By bbrunof in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-22-2013, 06:15 PM
  7. [SOLVED] Help: Can I change the date formula from mm/dd/yyyy to "mmm-yy" et
    By wintersunshine in forum Excel General
    Replies: 8
    Last Post: 07-05-2005, 05:05 PM

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