Text to Columns formatting issues with Date/Time - excel

I am trying to figure out if this is an Excel bug or just a formatting issue. So I have a column with a date and time in the format m/d/yyy h:m AM/PM (ie. 10/21/2015 2:21:00 PM), and am trying to split it into two individual columns: one with the date and one with the time. I tried using fixed width first, but ended up using delimited just so I could split it exactly where I wanted.
For some reason when it splits the two up, the actual value for time changes. I will end up with one column with the date and a time of 12am (10/21/2015 12:00 AM) and one column with the initial time minus 12 hours (2:21:00 AM).... Trying to figure out why there is still a time value in the date column and why the time value changes. Ideally I want to have a column with 10/21/2015 and another with 2:21:00 PM.
I've tried changing the format of the initial date/time combination etc. and it keeps on subtracting 12 hours from the initial time when it splits.
Has anybody experienced or heard of similar issues?

I think your question is confusing, for example I tried using fixed width first, but ended up using delimited just so I could split it exactly where I wanted. seems back-to-front, but you have a datetime value for October 21, 2015 14:21 hrs, want that as a date in one column and 02:21:00 PM in the next and your environment is UK style (ie day before month).
IF so Text to Columns may be as confusing as helpful. Format the date column as date (to suit) and the time column as hh:mm:ss AM/PM (or similar) and the following formulae may suit, assuming your datetime value is in A1:
For date: =INT(A1)
For time: =MOD(A1,1)

Related

Excel Date/Time not correct within same data

Minor thing and not sure if on the right place to ask.. but; I have a large dataset with dates, some of then have the correct date stamp, others are just a string of numbers and time which forms an optical date, but isn't. I figured out it has something today with a double space.
12/12/2016 13:01:32 PM
12/12/2016 12:33:46 PM (this one has 2 spaced between 2016 and 12)
the last one is the correct format for a date stamp
research:
http://www.mrexcel.com/forum/excel-questions/502863-extract-am-pm-text-date-time.html
Got it, the problem was in the data set.. with text to column I separated the date time and PM/AM.. then I can get the date and time separate and delete the last column.. thanks for your interest

Formatting Existing Excel Cells to Time Format Without Date

I'm working on an excel 2010 sheet where I mark down the date and time an event happens. The date is in one column, and auto formats to 17-Nov when I would type in 11-17 (I was fine with this). The time is in a separate column.
I am trying to find the average time an event occurred, without regard to the date, so I would use =AVERAGE(C1:C10). However, I only receive a date back (like 17-APR).
I did not format the cells before I began to enter in data, and I would simply type in a 3:27pm event as 1527, and no reformatting would happen.
Now, when I attempt to reformat the column to hhmm, all the numbers entered so far turn to 0000. When I try to edit the 0000, it is formatted as 6/13/1906 12:00:00 AM.
What I want to do is have the time formatted as hhmm and not include a date in the cell, and be able to run formulas on it, such as the average time an even occurred.
Summary:
*Currently time is entered simply as ####. I entered 3:27pm as 1527.
*Trying to reformat the time column results in 0000 in all cells in the column that previously had a ####.
*Modifying the 0000 displays as 6/13/1906 12:00:00 AM
*I want to format the time as hhmm so I can simply type in 2357, and have it display as 2357, but understand I mean 11:57pm, and let me take averages.
*Hell, even being able to enter 1547 and have it auto format to 15:47 or 3:47p would be great.
Thanks for reading my question!
An easy way to apply an autoformat (though Excel won't see it as a true "Time") is to go into Format Cells>Custom> and use ##":"##. This will turn 1245 into 12:45. Mind you, this will be a text string so if you copy it to another cell and then apply a time, it will show as 12:00:00. Excel will also not be able to run formulas on it, but it's a quick and dirty way to make it look pretty.
Another option is to have a formula such as =TIME(LEFT(A1,2),RIGHT(A1,2),) where A1 would be replaced with the cell you are actually referencing. This will convert the number to a time that Excel will recognize as a time allowing you to run other functions on it, but requires another column.
If you are entering the times as 4-digit numbers, you'll need to do a calculation to get the hours and minutes, then use the TIME function to get an actual time:-
=TIME(A1/100,MOD(A1,100),0)
Another way is
=LEFT(A1,2)/24+RIGHT(A1,2)/1440
but then you have to format the result as a time.
Excel sees a number like 1547 as approximately 4 years on from 1st January 1900 if you format it as a date, so it will come out as something like 26/3/1904 in UK format or 3/26/1904 in US-style format.
Note that the time function can only give you values up to 23:59:59 (stored as 0.999988426), but the second method will give you a datetime value with one or more days as the whole number part. This can be useful if you want to do calculations on times spanning more than one day.
The above behaviour is because dates and times are stored as real numbers with the whole number part representing days and the decimal part representing fractions of a day (i.e. times). In spite of misleading information from Microsoft here, dates actually start from 31/12/1899 (written as 0/1/1900) with serial number 0 and increment by 1 per day from then on.

Excel - Date Time Format ; If time is PM add a day

In excel I currently have data in date time format
For example: "11/10/2007 8:40:58 PM"
I am trying to extract the date and if the time is PM, I add a day.
if the time is AM, the date remains the same.
So since the time is 8:40:58 PM I would want 12/10/2007.
Is there a way in excel to do such a thing using formulas?
Please consider using the following formula. This uses the fact that in Excel in its date-time code uses 1 to represent a full day and fractions to represent the time. If timestamp is in A1 then:
=INT(A1)+IF((A1-INT(A1))>=0.5,1,0)
Regards.
This one works for me.
=IF(A1>0.5, A1+1, A1)
In order to have it only return the date right click on column B, select "Format" the take your pick.

Cannot convert serial number to date and time format

It's just as the title says, I cannot convert the serial numbers generated from the DATE and TIME function to a Date and Time Format.
I have this date: 27/11/2012 1:09 PM (originally typed in as text and not acknowledged as date and time, because it was aligned to the left). So instead, I decided to use the DATE and TIME function like so:
=(DATE(2014,8,26) & TIME(13,27,0))
It resulted with a serial number. So I googled on ways how to convert the serial number to a date format. OF course, I already tried formatting a cell by right-clicking it and selecting the Date category but still no luck.
Now that I think about it, is the formula above alright? I mean is it okay to use date and time in one cell? By the way, the dates and times were manually typed in in one cell. And I do not have an option to segregate each date and time elements per cell.
UPDATE: So I tried doing it with just the DATE function only and the formatting worked. Is there any way that even the time is included?
=(DATE(2014,8,26) + TIME(13,27,0))
Use "+" for date and time concord-nation :)

Excel - calculate date time

I am trying to calculate the hour difference between two times. What I've been doing now only gives me hour indications like 1:30, 2:45, etc but I can't make diagrams based on these values. If I get 2:30 as the hour difference, it should become 2,5. if the difference is 2:45 that should be 2,75.
Change your formula to:
(B2-A1)*24
and format as General
You should just be able to subtract 1 datetime from the other. Try this:
In cell A1, enter "09/17/2012 10:00" (Excel should automatically recognize this as a date)
In cell A2, enter "09/17/2012 11:30"
In cell A3, "=(A2-A1)*24". The result is 1.5.
The problem may be that you are trying to subtract 1 'time' from another 'time' without a date component. In that case, Excel may not recognize your value as a 'time'. Try adding a dummy date to the beginning of the time.
One limitation of this is that you will get an error response of "########" if the 2nd date is earlier than the 1st (because the result is negative). If this is an issue, try "=ABS(A2-A1)*24" instead.

Resources