Sort doesn't work, find will not find, video

Discuss the spreadsheet application
Post Reply
ironfistx
Posts: 27
Joined: Wed Aug 23, 2017 11:06 pm

Sort doesn't work, find will not find, video

Post by ironfistx »

Right, a couple issues -- when I am sorting by date, AM and PM values get mixed up. Alternately, when I find, it will not find a mark that every cell has.

https://youtu.be/grxur7ONqN8
openoffice 4 windows 10
FJCC
Moderator
Posts: 9274
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Sort doesn't work, find will not find, video

Post by FJCC »

Your dates are not numeric date values but text. That is the meaning of the ' that you see. The ' is not part of the cell content, it is a signal that your are dealing with text, and that is why you can't locate it with Find & Replace. This problem usually happens when data are imported from another source and it is best dealt with at that point. If your are using Insert -> Sheet From File, the problem can often be fix in the Import Text dialog by checking Detect Special Numbers and setting the column type to US English.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Sort doesn't work, find will not find, video

Post by RusselB »

Both of your problems are based on the same, real, problem.
The sorting is out of order because you are actually sorting texts, not numbers.
The ' that you are seeing tells Calc that the entry is text, however, the ' is not part of the data in the cell.
The process of formatting does absolutely nothing, as the formatting is for numbers and, at this point, you are dealing with text.
This is usually a problem with importing a .csv file and not setting the import parameters correctly.
When you imported the data (I'm guessing from a .csv file), you should've gotten the ASCII Text Import Dialog.
In that dialog, there is a checkbox, which is unchecked by default, marked Detect Special Numbers.
Additionally, there is a small preview screen. In that screen you can select the column and specify what kind of data is going into that column.
I usually have to use that in order to ensure that the dates in the column are recognized in the correct order, as some sources use MM/DD/YY (Month/Day/Year) as others may use DD/MM/YY (Day/Month/Year)
If you still have the original data file, I'd recommend just re-importing it using the settings as I've suggested.
If you don't, or don't want to re-import the data, then you can use Data -> Text to Columns to get the information in your column A as numbers.
Please see [Tutorial]Ten concepts that every Calc user should know and [Tutorial]text to Columns
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Sort doesn't work, find will not find, video

Post by acknak »

 Edit: Oops! 
Too late. Oh well, here's another version of the same answer ...
ironfistx wrote:... sorting by date, AM and PM values get mixed up.
Your date values are text and are therefore sorted alphabetically. This could work if the date+time text strings were in a fixed format (same number and positions for every character) and strictly left-to-right quantity (most significant value to least significant; year > month > day > ...). Your date+times don't fulfill any of those requirements, so sorting is not going to give sensible results.

The best approach is to convert the date+time values to Calc's numeric date+time. I think you can do this easily by

1) selecting the date cells
2) make sure the cell format is set to something that accepts numeric values (anything other than "Text")
3) Data > Text to Columns, set the delimiter ("Separated by") to tab (any character NOT in the text) and OK.

This forces Calc to re-interpret the text and convert to numeric values, if possible.

I prefer to keep the text values, so I copy to a new column and then convert, but it's not strictly necessary.

Changing the cell format has no effect on the values stored in the cell; you can't convert data type by changing the format. The cell format has no effect on text values.

Also, you can't remove the apostrophes by Find/Replace because they aren't part of the value stored in the cell. They are only a marker on input that tells Calc NOT to interpret the input as a number of some kind but to take it as literal text.

Finally, if you're routinely importing similar data, you probably want to adjust the import configuration to have Calc do the date to numer conversion as part of the import, so you don't have to perform a separate step.
AOO4/LO5 • Linux • Fedora 23
Post Reply