Exported dates not sorting correctly - excel

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.

Related

Extract data between two dates

I have a bunch of data on the first sheet (Manifest) of my Excel file.
Like this:
On the ByDate sheet, I want to be able to put in two dates, and then display all the data between those two dates from the Manifest sheet. (Based on the date on Column G [named DATE REQ'D] for the Manifest sheet)
So I follow instruction by:
https://www.youtube.com/watch?v=6jcqN3swdW8&t=322s
On my cell A7 (where I want the data to start) I put:
=IF(ROWS($A$7:A7)>C2,"",INDEX(Manifest!$G:$G,SMALL(IF(Manifest!$G:$G>=ByDate!$A$2,IF(Manifest!$G:$G<=ByDate!$B$2,ROW(Manifest!$G:$G)-ROW($A$7)+1)),ROWS(A$7:A7))))
For some reason, I don't get any data but the number 42741. This can be seen in my second picture.
Can anyone tell me what I did wrong and how to fix it?
Update:
I changed the cell's format to date. But my problems are:
1.The date that appeared is not in between the two dates.
2. I thought when I dragged the cell across (copy without formatting) I would get the rest of the data such as order Number, customer...etc but I just get blank spaces:
While in cell A7 on the ByDate worksheet, go to the HOME tab of your ribbon, then to the Number group and click the drop-down.
Now select one of the date options (either Short Date or Long Date) to get your number to appear as a date.
A quote from the Help guide for Excel: Excel stores dates as sequential serial numbers so that they can be used in calculations. That's why your date looks like a number instead of a date.

Excel text to date format issue

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.

While dragging date from top, i would like to get that list in weekends

If i want to drag the date to right/left, i want it in weekend format.
As follows
sun,9/07/2014
sun,9/14/2014
sun,9/21/2014
can anyone provide me the answer?
There is no such thing as a "weekend format" in Excel, there is only date format. A lot of them, but as formats, they only affect the way the data is shown, not the data itself.
However, if you type the two first dates of the series (the 7th and the 14th), and then select them both and drag them, Excel should be able to detect that you want only the sundays, and fill the rest of the series properly.
Define the format in cell formatting to ddd,mm/dd/yyyy that should show you the date in the format you need.

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