Excel text to date format issue - excel

I have the same issue as this OP when trying to change the date format
Excel 2010 date formatting not working on some cells but on others
The solution does work on converting those 'Text' to date format. However for the other datas in the same column which are in 'Date' format they give a #VALUE! error as shown in the image below when the entire column uses the formula.
Is there anyway to resolve this issue other than manually keying in the date which does not need to be fix, as I'm afraid in the future I might have more than a few thousands date to manually change
The formula I've used is this which the entire column uses,
=DATE(RIGHT(A2,4),LEFT(A2,FIND("/", A2,2)-1),MID(A2,FIND("/",A2)+1,2))

The data in column A is a mixture of text that looks like dates, and real dates. All rows with the error have the dates as real dates and the left/right/mid functions don't work on the format but on the underlying value, which in the case of the dates is a number. Try it just =RIGHT(A4,4) to see what I mean.
In order to run the formula, all data needs to be text. You can quickly convert the data to text by selecting column A, then click Data > Text to columns > Next > Next > Select "Text" in step 3 and click Finish.
The data will be converted to text and all your error values will disappear.

Related

Date: Text to Columns

As previously explained by one member of the community, I converted a text date format into a date format using "Text to columns"
Select column of dates then Data > text to columns > Next > Next > "under column data format" select "Date" and the format from dropdown (MDY or DMY) > OK
However, as you can see on the screenshot, some dates do not convert. I tried various things but do not find a reason. If anyone could help, it would be greatly helpful
The only way to replicate this seems to be formatting the cells appearance to dd.mm.yy. The fix being to change the cell format (visual mask) back to a standard date format. Text to columns does change the underlying data successfully.
Got it. Initially, my dates (text format) were MDY but I used DMY (in text to column)and it only worked for 60% of the dates. Then I used MDY (in text to column) and it works for 100% of the dates converted.

Excel: Date format is throwing up random numbers when using a function

I am using a INDEX, MATCH function in sheet Car Search to pull data from sheet Raw Data. One of the cells is Date Purchased, this will show the date in format dd/mm/yyyy (UK Format).
The problem is, when I enter a date in this format, it doesn't correctly pull over to the Car Search sheet. Instead, it shows up 42350 when I entered 12/12/2015 in the Raw Data sheet.
Both cells have been formatted to Date, but it is still showing up as 42350 and not 12/12/2015.
Is it because the function is preventing it from showing date format?
Anybody know why Excel does this? I have tried on a new sheet, but same result.
Any help much appreciated :)
Please see images below.
if you're still not getting it after you change the format of the cell, you can surround the index/match formula you've written with =text(b4, "mm/dd/yyyy") which will format the 5 digit number you've gotten as a date.

Exported dates not sorting correctly

I'm using an application called Kroll OnTrack to manage a review of documents as part of a litigation project. Kroll can export the metadata for these files into an XLS file. The problem is that when Kroll exports the dates for these documents, it seems to do so as a string, and the dates are being exported in MM/DD/YYYY format, so when I go to sort by date, the documents line up in this order:
01/01/2005
02/02/2005
03/05/2010
04/07/2006
05/03/2007
...and so on.
I need to be able to sort the table by date so we can put together a chronology of these documents. Trying to force Excel to re-format as a date doesn't seem to work, nor have I had any luck using DATEVALUE(). Right now, I'm doing text-to-columns then re-concatenating the dates, which seems to work, but is there a more elegant/efficient solution for this issue?
Perform Text-to-Columns on that column of dates but with some optional commands.
On the first screen of the T2C wizard, choose Fixed Width and click Next.
On the second page of the wizard, discard any border that Excel added by dragging them up out of the Data Preview window. It is very likely that none will be there. Click Next.
On the third page of the wizard, choose Column data format, Date and MDY from the drop-down selector beside Date.
Click Finish.
You should be left with real dates in the column. This procedure is easily recorded for future use.
In a column adjacent to your text dates, you could try something like this
DATE(RIGHT(E3,4),LEFT(E3,2),MID(E3,4,2))
Then copy down and sort/filter on this column of real dates.
Where cell E3 contains you text-date. You could also follow up with Text(...,"yyyy-mm-dd") or some other date format, if you need the date in a specific format.
The formula assumes that the text string contained in cell E3 is of length 10 (i.e. all white space is trimmed and padded zeros for day and month are used). If this is not the case, the forumula is easily amended.

Different date formats in Excel

I have a csv that contains a list of dates, once imported into Excel they are in 2 different formats. How can I get them all in the same format?
Example:
01/23/2012
01/26/2012
40910
41031
You probably have a BIG issue with your file!
Probably, Excel is recognizing dates as "dd/mm/yyyy" but your data is "mm/dd/yyyy" formatted.
So, your numbers are really dates (just format, as #t.thielemans suggested). But are incorrectly parsed - month and day are switched!
Solution (assuming your dates are on A:A column):
To convert text to date:
=DATE(RIGHT(A1;4);LEFT(A1;2);MID(A1;4;2))
To correct day/month:
=DATE(YEAR(A1);DAY(A1);MONTH(A1))
Detect whether cell has date (dates are numbers, in Excel) or text:
=ISNUMBER(A1)
Finally, all combined within one formula:
=IF(ISNUMBER(A1);DATE(YEAR(A1);DAY(A1);MONTH(A1));DATE(RIGHT(A1;4);LEFT(A1;2);MID(A1;4;2)))
Just drag last formula from first row to end of your data and then format it as you wish (see #t.thielemans solution).
Select your data column and make sure they're highlighted. Go to Home>Number and select Custom and enter mm/dd/yyyy. You can also change the layout to one you want (mm-dd-yyyy/mmddyyyy/dd-mm-yyyy/...)

Extracting dates from a Microsoft Excel file when dates are in many different formats

I have been given an excel file with dates in a column for about 17000 rows. The problem here is that the dates are not reliable and the cells have varying formats. Some are formatted as plain text, some are in the "general" format, yet others are in one of several available date formats. In one case, I even found a date in a cell formatted as mm/dd/yyyy yet the date is showing up as 20/05/1989.
The only thing consistent about the dates is that they are actually date-first and month-second to the human reader, irrespective of whatever the format of the cell is. Another things is that the date separator isn't consistently used, some dates have the hyphen, some have the slash and yet others use the dot as the separator.
I intend to add another column next to the column with the dates, and have this column formatted as pure text. Now if I use the formula =TEXT() then this would of course give me the serial (excel) date.
Is there a way to get these dates as text, using VBA if necessary?
If I understand you correctly, you want to get a text version of what is displayed in the Excel sheet. Easy way to do this is save the sheet (or just the column in another sheet) as a Formatted Text (Space delimited)(*.prn) file. When you reopen the file, it will be treated as an importable text file.
Please try this formula across and advice.
=DAY(A1)&"-"&MONTH(A1)&"-"&YEAR(A1)
Regards
Shiva

Resources