+ Reply to Thread
Results 1 to 14 of 14

Avoid string to default to date

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Avoid string to default to date

    Hello,

    I have an application, which exports data into excel.
    The data contains strings such 01-11 or 3-09 etc.
    The moment, the spreadsheet loads, it automatically converts those strings to a date like Jan-11 or Mar-9.
    I am wondering if there is something in the settings, I could change to avoid this? If not, how can I convert those dates back into the original string (to preserve also the "zeros" within the string.
    Could you please advise?
    Thanks

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,462

    Re: Avoid string to default to date

    Have you tried formatting the destination columns as text before importing?

  3. #3
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Avoid string to default to date

    Pepe Le Mokko,

    I can not format the columns because when the data is being exported from the APP, it generates a new excel file and the data lands in it before even I could make a change.
    Now when the excel file opens, first it shows the format I want but the moment I start doing anything within the spreadsheet, it automatically converts to date.
    FYI
    Thanks

  4. #4
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Avoid string to default to date

    unsure if there is a way to fix this in the settings. As for a formula though. if your data starts in A1 then:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <----- If you are happy with your solution please click on the "* Add Reputation" as a way to say thank you.

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,661

    Re: Avoid string to default to date

    How is the spreadsheet being loaded into Excel? Is it a .csv file? If so, attach a desensitised copy here.
    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.

  6. #6
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Avoid string to default to date

    AliGW,

    Please see attached Excel file.
    The file which comes from the App is a CSV file.

    FYI
    Thanks
    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 (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,661

    Re: Avoid string to default to date

    Yes, however how are you importing it? What steps are taken, please?

    I need you to attach the .csv file, please. BEFORE imported into Excel.

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,922

    Re: Avoid string to default to date

    To my knowledge, there is no setting in Excel for "stop auto detecting dates."

    Excel uses your operating system's regional and language settings for deciding what a "date" looks like. If you are willing (or allowed) to tinker with the system wide settings in your OS, you might try different date format defaults to see if you can give the system a default date format that looks nothing like the text you are trying to import and see if Excel stops detecting these as dates.

    That said, I suspect that the easiest place to stop this behavior is in this (unknown to us) external app. Does this app have a setting that allows you to decide if it auto-opens Excel? Can you change anything about the text output (like adding a leading apostrophe or other character) to these values so Excel will not auto-detect them as dates? Are there any settings in the app for controlling how it exports data?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  9. #9
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Avoid string to default to date

    AliGW,
    See attached CSV file.
    Thanks for looking into this!
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Avoid string to default to date

    MrShorty,

    Thanks for your response.
    I will address this to the App Support.

  11. #11
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,661

    Re: Avoid string to default to date

    This copy of the file has been saved from an Excel file and the strings already converted to dates.

    I need to see a copy of it BEFORE it has been anywhere near Excel.

  12. #12
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Avoid string to default to date

    ok the fix you need to do is to open a blank workbook. In this workbook open the csv file extract. This will bring up the Text to Column wizard.
    Select DELIMITED then hit Next.
    Put a Check mark next to comma and remove the check mark from tab. Then hit Next
    Finally highlight the second column which has your items that keep turning into dates. Once highlighted select Text at the top to convert column into Text.
    Then hit finish
    Attached Images Attached Images

  13. #13
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Avoid string to default to date

    Thank you dosydos!.
    I can use this solution.

  14. #14
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Avoid string to default to date

    Glad it will work. 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. Store String Values to Avoid Re-Using
    By visualnotsobasic in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-11-2018, 05:02 PM
  2. [SOLVED] Find String in given Range without utilize Array [could avoid case sensitive]
    By alexnkc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2017, 07:20 AM
  3. Replies: 4
    Last Post: 05-28-2015, 09:13 AM
  4. How can i avoid the String of Characters While converting fraction values
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-10-2014, 07:52 AM
  5. [SOLVED] How to append sequential number to a text string to avoid duplicates?
    By wes228 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-13-2014, 08:20 PM
  6. Avoid String been converted to decimals in CSV files.
    By krishnarao in forum Excel General
    Replies: 1
    Last Post: 06-11-2009, 09:19 AM
  7. How do I avoid fields being automatically filled in by default?
    By jason in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-15-2006, 06:35 PM

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