Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8671427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:56:52+00:00 2026-06-12T18:56:52+00:00

I have a CSV file, delimited by comma and I have some date values

  • 0

I have a CSV file, delimited by comma and I have some date values inside it, like "01/13/2010 05:00:00 AM", or "04/01/2010 05:00:00 AM". The issue is that when I open the CSV file with Microsoft Excel, it will show these days as 01/13/2010 05:00:00 AM and 04/01/2010 05:00, respectively. The value of the second one is 04/01/2010 05:00:00, but it still shows 04/01/2010 05:00. I’ve made a few tests and I’ve realized that Excel is not able to determine which is the day and which is the month in a few cases. In fact Excel gets a string like:

__/__/____ __:__:__ __

It deduces from the last two characters (AM/PM) the value of hour, it knows what the minute and second is, also, it determines the year when it sees the four-character long number sequence, so the question is about month and day. If the first and the second number from the string are both <= 12, then it can’t determine which is the month and which is the year, so it messes up my date format.

I would like to have a date format such as

MM/dd/yyyy HH:mm:ss AM/PM

and I’ve found out that using the function called TEXT is able to do just that, like this:

=TEXT("04/13/2010 05:54:00 AM", "MM/dd/yyyy HH:mm:ss AM/PM")

It works like a charm, but it still guesses which is the day and which is the month. However, assuming that the clients will have the same default date format as the data in the CSV, the month and the day won’t be inverted. However, I don’t want to open Excel and type the formula in, because I need to give this file to clients and it should show the right value whenever they open the file. So, I need to write the formula inside the comma-separated file, but… TEXT is two-dimensional and there is a comma separating my date from my format.

If I type:

= ABS(-5),=TEXT("04/13/2010 05:54:00 AM", "MM/dd/yyyy HH:mm:ss AM/PM")

into my file, I will see 3 cells, the first being 5, the second is =TEXT("04/13/2010 05:54:00 AM" and the third is "MM/dd/yyyy HH:mm:ss AM/PM").

How can I prevent this behavior? Can I use something else instead of the comma inside my function call? Or can I change the separator? Or is there a better solution?

Can you enlighten me, to learn how can I enter function calls inside a CSV file?

Thanks in advance to everybody who tries to help,

Lajos Árpád.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:56:53+00:00Added an answer on June 12, 2026 at 6:56 pm

    If I type:

    = ABS(-5),=TEXT("04/13/2010 05:54:00 AM", "MM/dd/yyyy HH:mm:ss AM/PM")
    

    into my file, I will see 3 cells, the first being 5, the second is
    =TEXT(“04/13/2010 05:54:00 AM” and the third is “MM/dd/yyyy HH:mm:ss AM/PM”).

    To make this example work, you need to surround your second data item with double-quotes to escape the comma. As a consequence, you need to use double double-quotes to have them interpreted as double-quotes inside the double-quotes — I hope this is a readable sentence.

    So the example you give should work if you use this in your file:

    =ABS(-5),"=TEXT(""04/13/2010 05:54:00 AM"", ""MM/dd/yyyy HH:mm:ss AM/PM"")"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a csv file that is comma delimited. I have no problem with
Possible Duplicate: Reading csv file I have a comma delimited file: Some Text, More
I have a CSV file that has lists of values for some fields. They're
I have a comma delimited file myfile.csv where the 5th column is a date/time
I have .csv file that contain 2 columns delimited with , . file.csv word1,word2
I have a CSV file that goes something like this: ['Name1', '', '', '',
I have a comma delimited CSV file being loaded into a String value generated
I am using C#, I have a comma delimited csv file with different strings
I have 3 csv files I'd like to combine. Each file has 3 comma
I have a malformed tab delimited csv file Name AA BB CC AA BB

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.