+ Reply to Thread
Results 1 to 8 of 8

Help with converting date using EOMonth formula

  1. #1
    Registered User
    Join Date
    09-06-2021
    Location
    Sydney
    MS-Off Ver
    2019
    Posts
    21

    Help with converting date using EOMonth formula

    Hi there, I am working with a dataset of thousands of rows. Each row has a date field. The data I have extracted have 2 types of date fields. One that has "dd/mm/yy hh:mm" and another that has "dd/mm/yyyy hh:mm". I am running a 'EOMonth' formula on the column next to them so that I can bring all values that fall in a month to a particular day. However, when I run the EOMonth next to the format that has "dd/mm/yyyy hh:mm", it is generating a value error. I have attached a copy of a sample spreadsheet.

    I am looking for a formula or a method with multiple formulas to easily convert thousands of rows of "dd/mm/yyyy hh:mm" to an end of month date.

    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,366

    Re: Help with converting date using EOMonth formula

    A5, A6 and A7 are not real dates - they are text. If you change the formatting of column A to general, you will see the difference.

    Where have these come from? It looks like they are in US format.
    Last edited by AliGW; 09-30-2021 at 04:47 AM. Reason: Typo
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-06-2021
    Location
    Sydney
    MS-Off Ver
    2019
    Posts
    21

    Re: Help with converting date using EOMonth formula

    Thank you for your response. They were exported from google analytics, so that might be why. I know that A5-A7 are not dates, but I am looking for a formula that can manipulate them to change into a date?

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Help with converting date using EOMonth formula

    This should do the trick: =EOMONTH(INT(A2),0)
    Click the * to say thanks.

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

    Re: Help with converting date using EOMonth formula

    OK, however I think you have a more fundamental problem to grapple with first.

    If these dates have ALL come from the same source, and that source is one with the US date format, then the likelihood is that ALL dates in column A, even those presenting as correct, are in fact wrong.

    07/02 should probably be 02/07 ...

    Before we go anywhere with this, go back to the source data and check this, because if we proceed as is, you are going to have a lot of incorrect data, I'd wager!!!

    This should do the trick: =EOMONTH(INT(A2),0)
    Doesn't address the issue, Paul.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,366

    Re: Help with converting date using EOMonth formula

    If you are confident that the dates presenting as dates are CORRECT, then you could try this in B2 copied down:

    =EOMONTH(IF(ISTEXT(A2),DATE(MID(A2,FIND("|",SUBSTITUTE(A2,"/","|",2))+1,4),SUBSTITUTE(LEFT(A2,2),"/",""),SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"/","|",1))+1,2),"/",""))+RIGHT(A2,5),A2),0)
    Attached Files Attached Files
    Last edited by AliGW; 09-30-2021 at 04:36 AM.

  7. #7
    Registered User
    Join Date
    09-06-2021
    Location
    Sydney
    MS-Off Ver
    2019
    Posts
    21

    Re: Help with converting date using EOMonth formula

    Thank you! you were right and I needed to fix an underlying issue. I have done that now, I really appreciate your help with this

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

    Re: Help with converting date using EOMonth formula

    Glad to help. Thanks for the rep.

+ 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. SUMIF function including EOMonth or Date Range
    By harmanm in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 06-06-2020, 01:36 AM
  2. SUMIF function including EOMonth or Date Range
    By harmanm in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 06-06-2020, 12:36 AM
  3. SUMIF function including EOMonth or Date Range
    By harmanm in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-05-2020, 07:19 PM
  4. EOMONTH Date + 1
    By marcygiff in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-05-2018, 11:39 AM
  5. [SOLVED] EOmonth Date using VBA
    By hudson andrew in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-09-2017, 01:19 PM
  6. [SOLVED] Adjust EOMONTH formula to return closest end of month date to today?
    By nobodyukno in forum Excel General
    Replies: 8
    Last Post: 01-19-2017, 07:51 PM
  7. IF before date using EOMONTH
    By Rosco88 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-14-2016, 07:33 AM

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