Convert from US to UK format - excel

How do I modify the following to be D/M/YYYY?
8/7/20 6:20 PM
8/17/20 4:24 PM
Currently it is M/D/YY
Here is what I have done to no avail:
=VALUE(LEFT(A2,FIND(" ",A2,1)-1)) - This is to extract the date portion (because excel sees it as text)
Tried to convert the date to a D/M/Y using 'text to columns' but that does not work. Excel sees the middle number as the date so anything over 12 and it throws an error.
Thank for any help on this. It's breaking me.

use:
=TEXTJOIN("/",,FILTERXML("<a><b>"&SUBSTITUTE(LEFT(TEXT(A1,"d/m/yy")&" ",FIND(" ",TEXT(A1,"d/m/yy")&" ")-1),"/","</b><b>")&"</b></a>","//b["&{2,1,3}&"]"))+MID(TEXT(A1,"\ hh:mm AM/PM"),FIND(" ",TEXT(A1,"\ hh:mm AM/PM"))+1,99)
and then format the output as desired.
Note: I am US based so I had to reverse it in the demo.
Another Note: If one is US based dealing with UK dates then change the d/m/yy to m/d/yy and it will work.

Related

mmm dd, yyyy hh:mm AM/PM not being recognized in excel

I have an Excel file in which the dates are in this format:
mmm dd, yyyy hh:mm AM/PM for example (Aug 19, 2021 10:15 AM)
Sadly, Excel is not recognizing it as text. I tried all listed methods but none does work. I need this field to be recognized as a date instead of text. How can this be done?
After searching for a long time and trying various methods (trying different versions of excel, using python code to convert the sheet, using format option in excel...) I found a solution.
Changing the region settings (Start>type-Run>enter>type-control international>enter) from Match Windows display language to English (United States) worked.
After performing the change excel was able to recognize the format as date and I was able to sort.

How to convert date formats in excel (dd/mm/yyyy hh:mm:ss to mm/dd/yyyy hh:mm:ss) [duplicate]

How do I modify the following to be D/M/YYYY?
8/7/20 6:20 PM
8/17/20 4:24 PM
Currently it is M/D/YY
Here is what I have done to no avail:
=VALUE(LEFT(A2,FIND(" ",A2,1)-1)) - This is to extract the date portion (because excel sees it as text)
Tried to convert the date to a D/M/Y using 'text to columns' but that does not work. Excel sees the middle number as the date so anything over 12 and it throws an error.
Thank for any help on this. It's breaking me.
use:
=TEXTJOIN("/",,FILTERXML("<a><b>"&SUBSTITUTE(LEFT(TEXT(A1,"d/m/yy")&" ",FIND(" ",TEXT(A1,"d/m/yy")&" ")-1),"/","</b><b>")&"</b></a>","//b["&{2,1,3}&"]"))+MID(TEXT(A1,"\ hh:mm AM/PM"),FIND(" ",TEXT(A1,"\ hh:mm AM/PM"))+1,99)
and then format the output as desired.
Note: I am US based so I had to reverse it in the demo.
Another Note: If one is US based dealing with UK dates then change the d/m/yy to m/d/yy and it will work.

Convert date Excel

Trying to convert Italian date. I got dates from pdf like 21 Giu 2020 which I paste into Excel and then try to format cells and choose option "Date" and 14-mar-12 there but it does not respond. It does only when I change 21 Giu 2020 to 21.12.2020 then it is 21-giu-2020.
Is there any way to automate it, else I need to search upon Italian months and conver Ago to 08, Giu to 12 etc etc?
If your locale isn't Italian, I doubt that Excel would ever recognize a string like that as a date. Here is a formula that would create the date for you:
=DATE(RIGHT(A1,4),MATCH(MID(A1,4,3),TEXT(DATE(2020,SEQUENCE(12),1),"[$-410]mmm"),0),LEFT(A1,2))
The avobe usage of SEQUENCE requires ExcelO365. I also made the assumption your text is always in the pattern "dd mmm yyyy".
You'll end up with a date which you can then use number formatting of your liking.

Excel adding dates to specific date format

I have dates coming out of a database into a column that have this format:
Column K
AUG-14-2015 08:31:32 AM
AUG-12-2015 06:10:03 PM
AUG-12-2015 05:17:51 PM
I want to add like '2.2' days to each of these and put them in Column L. I have formatted the column in this format:
mmm-dd-yyyy hh:mm:ss AM/PM
I wasn't sure if the dashes are causing the problem, but when I do a =K15+2.2 I get a !VALUE. Any ideas what I need to do? Thanks.
After some experimenting, it seems that while you can specify a date format "mmm-dd-yyyy hh:mm:ss AM/PM", the actual entry into the cells must be either a date in the system wide locale specific format, or a number of days since 1 January 1900.
So for example when you set a cell's format to custom:
"mmm-dd-yyyy hh:mm:ss AM/PM"
In my case (Windows 10 default UK locale settings, Excel 2010) for AUG-12-2015 06:10:03 PM, I can enter any of:
12/08/2015 06:10:03 PM
12/08/2015 18:10:03
42228.26
And also exchange the month 08 for Aug or AUG in any case and change the '/' for '-' in the dates.
For cells formatted "mmm-dd-yyyy hh:mm:ss AM/PM", the output for any of the above inputs is:
Aug-12-2015 06:10:03 PM
Note that there does not appear to be a means to force all-capitals for the month.
Note also that if you enter a date/time in the locale format it is automatically recognised and formatted as date/time.
So really your only option is to either change the format of the source data, pre-process the data into locale date/time format, or write a macro to do it within the spreadsheet. It may also work perhaps if you change your locale settings (System Settings, Language & Time), but that is perhaps less than satisfactory because it will affect date presentation for the whole system.
If you want to avoid VBA, then you can add a column("L") next to your data and enter:
=SUBSTITUTE(K1,"-","/")
Another solution would be to write code to do just that to your existing "K" Column

How to create and assign a Custom Format of date and time to an entire column in excel worksheet

I want a customized format(with milliseconds also) in such a way to handle for a date and time in Microsoft Excel.
Sample date and time:
08.25.2010 00:52:09.359
For understanding of above sample date time, it is 25th August 2010 12 hrs 52mins 9seconds 359 milliseconds(AM).
Please provide a custom Format to handle the above mentioned sample date and time and finally to apply for a column.
In Excel 2003 I use the following for time with fractions of second:
"hh:mm:ss,000"
(note: my decimal point is a "," - German)
so a time entered as 12:13:14,1516 will be displayed as 12:13:14,152
Hope this works for you
Edit 28-Nov-2012
I recently migrated to Excel 2010. Special format using up to 3 zero's after a comma for seconds as described above still works. More than 3 zero's however are not accepted.
I'm not certain what you mean by "not recognizing the dates" but the following custom format would give you the format you're looking for. You'll have to adjust the millisecond separator "." according to your localization, of course.
mm.dd.yyyy hh:mm:ss.000
Applying it to a column is as easy as right clicking the column header, selecting Format Cells, choosing Custom on the left and pasting that format string into the Type box.
If you're trying to enter dates in this format, I don't believe that Excel will support that. I don't know of any option to set the date separators to a "." for Excel. Even setting the date format to use dots under the Regional and Language Options doesn't make Excel recognize that.

Resources