+ Reply to Thread
Results 1 to 21 of 21

Converting Text to Date then using an IF formula

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Converting Text to Date then using an IF formula

    Hi,

    I have two dates on a file and I need an If formula to say If effective date is greater than inital date then "Yes", if not "NO".

    My problem is the dates are in both text and USA format so I would need to convert them first.

    Any ideas how?
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Converting Text to Date then using an IF formula

    Multiply each of the dates by 1 and then apply the format you wish.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Converting Text to Date then using an IF formula

    Hi,

    That doesnt work for the second date - get an #Value error

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Converting Text to Date then using an IF formula

    Worked for me in the file you presented. Have you a different file that you working with?

  5. #5
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Converting Text to Date then using an IF formula

    This is the actual file. The cell in yellow is the formula (the ones on the right is my attempt to get it to work - it doesnt)

    Any ideas?
    Attached Files Attached Files
    Last edited by pauldaddyadams; 05-30-2014 at 04:23 PM.

  6. #6
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Converting Text to Date then using an IF formula

    In the example file above it appears that the dates are not being exported correctly - is there a work around for this?

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Converting Text to Date then using an IF formula

    In the file you posted, there are no cells in yellow. Here is your file back with my change which works.

    EDIT: Didn't see the second file. Looking at it now.
    Attached Files Attached Files

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Converting Text to Date then using an IF formula

    I have looked at the new file. There is no formula in any of the cells in column P except for the first row. I am very confused as to what you want now. If I copy the formula down from row 2 it appears to give the required answer.

    Alan

  9. #9
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Converting Text to Date then using an IF formula

    Hi,

    This still will not work for me and I dont know why?

    I have reuploaded the file
    Attached Files Attached Files

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Converting Text to Date then using an IF formula

    I think I got what's going on. Look at the attached.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Converting Text to Date then using an IF formula

    Hi

    It works for most but rows 22 and 23 are wrong - I can not see why though?

  12. #12
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Converting Text to Date then using an IF formula

    Hold fire as I think it might just be me reading the dates wrong!

  13. #13
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Converting Text to Date then using an IF formula

    This is making me go mad. On the file you sent me if I go into the cells in G and hit return on some of them they error out.

    Why is this?
    Attached Files Attached Files

  14. #14
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Converting Text to Date then using an IF formula

    It worked fine for me. I think that the issue is the file is set up to US date standard and your machine is set for EU date standard. I've never been really good with sorting that stuff out as I never really needed to be concerned. You will have to figure out a workaround to either have your machine read it in US format or change the it somehow before you go any further.

  15. #15
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Converting Text to Date then using an IF formula

    Thanks alansidman for looking into this.

    I am going to leave it as open in the hope someone else knows. In the latest upload I need to try and elimiante the #Value errors, anyone know how (or even why)?
    Attached Files Attached Files

  16. #16
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Converting Text to Date then using an IF formula

    My last shot at this, Paul.

    This appears to do what you need.

    http://stackoverflow.com/questions/4...pean-date-date

  17. #17
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Converting Text to Date then using an IF formula

    Hi,

    I have tried all the formulas in the link you provided and still nothing.

    I still get errors no matter what formula I try on certain dates - doesnt anybody know why?

    Paul
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    01-28-2008
    MS-Off Ver
    Excel 365
    Posts
    157

    Re: Converting Text to Date then using an IF formula

    When I format F:G as general, some of the entries still show as dates. When I delete those entries and re-enter them, this seems to correct the problem.

    You must re-enter all dates that don't change to serial numbers when you format as general. I don't know why.

  19. #19
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Converting Text to Date then using an IF formula

    Hi,

    Try this array formula**:

    =IF(SUM(IFERROR(0+TEXT(F2:G2,"mm/dd/yyyy"),0+RIGHT(REPLACE(F2:G2,7,0,LEFT(F2:G2,3)),10))*{-1,1})<0,"Effective is After due","Effective is NOT After due")

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  20. #20
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Converting Text to Date then using an IF formula

    Hi,

    I have tried that formula however it didnt work - I am unsure why exactly other than its reporting some dates before the inital when they are not.

  21. #21
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Converting Text to Date then using an IF formula

    Could you re-post your attachment with that formula included and highlight where you think the results is incorrect?

    Regards

+ 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. Converting Text to Date & Sorting on Date
    By andresndor in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-10-2014, 04:48 PM
  2. Converting text string that contains a date and time to a date
    By jmforde in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-12-2013, 02:31 PM
  3. Replies: 0
    Last Post: 01-30-2013, 07:05 PM
  4. [SOLVED] Converting from Text>Date Serial>Date
    By Schwartz in forum Excel General
    Replies: 17
    Last Post: 04-17-2012, 04:26 PM
  5. Converting date text to date format
    By reggie1000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2009, 06:10 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