[Solved] Sort Data Numerically
-
hroberts89436
- Posts: 9
- Joined: Wed Dec 07, 2011 7:00 am
[Solved] Sort Data Numerically
Ok I searched thru the forum and I am having an issue with sorting numbers. Here is a small sample that I have sorted as numbers->general:
10000075
1000011
10000687
100055
1000627
10006530
10007358
10011250
1001475
100155
1001648
10022936
10023065
1002750
Reminder this is after the sort of over 9,000 numbers why wont it sort properly, how can I make it sort numerically?
10000075
1000011
10000687
100055
1000627
10006530
10007358
10011250
1001475
100155
1001648
10022936
10023065
1002750
Reminder this is after the sort of over 9,000 numbers why wont it sort properly, how can I make it sort numerically?
Last edited by MrProgrammer on Thu Oct 31, 2024 6:44 pm, edited 3 times in total.
Reason: Lock ancient topic
Reason: Lock ancient topic
Open Office Version 3.3.0 on windows XP Pro SP3
Re: Sort Data Numerically
Your datas are not numbers, so you sort them alphabetically.
[Tutorial] Ten concepts that every Calc user should know
[Tutorial] Ten concepts that every Calc user should know
LibreOffice 6.4.5 on Windows 10
Re: Sort Data Numerically
Turn on / View / Value Highlighting. All numeric entries are now highlighted in blue, all alphabetic entries in black.
Last edited by RoryOF on Wed Dec 07, 2011 5:30 pm, edited 1 time in total.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
Re: Sort Data Numerically
How do 9000 numeric text values get into your spreadsheet? This does not happen by accident.Reminder this is after the sort of over 9,000 numbers why wont it sort properly
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
hroberts89436
- Posts: 9
- Joined: Wed Dec 07, 2011 7:00 am
Re: Sort Data Numerically
Read my post. I already stated they were numbers. I highlighted the entire column, selected format cells, then numbers, general.gerard24 wrote:Your datas are not numbers, so you sort them alphabetically.
[Tutorial] Ten concepts that every Calc user should know
Open Office Version 3.3.0 on windows XP Pro SP3
-
hroberts89436
- Posts: 9
- Joined: Wed Dec 07, 2011 7:00 am
Re: Sort Data Numerically
this is a dump of a database. these are sales ranks I need to sort to know which is the better selling items.Villeroy wrote:How do 9000 numeric text values get into your spreadsheet? This does not happen by accident.Reminder this is after the sort of over 9,000 numbers why wont it sort properly
Open Office Version 3.3.0 on windows XP Pro SP3
Re: Sort Data Numerically
You data are not sorting as numbers. Try / View / Value Highlighting, which is the proof of whether they are or are not numbers. If they are not numbers, then you need to find a mechanism to turn them into numbers.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
Re: Sort Data Numerically
It is a widely-held misconception that doing this has some effect on the values stored in the cells. It does nothing.hroberts89436 wrote:... I highlighted the entire column, selected format cells, then numbers, general.
If you had text values in the cells to begin with then you still have text values, regardless of what number format is applied to the cells.
AOO4/LO5 • Linux • Fedora 23
Re: Sort Data Numerically
If I cut and paste your data into Calc they paste as values. But as has been said previously you likely have text not values. Try using the Value function to convert the text to data that can be sorted.
Value(Text) is the formula.
Value(Text) is the formula.
Tom K.
Windows 11 24H2
LibreOffice
Windows 11 24H2
LibreOffice
Re: Sort Data Numerically
Does that sequence of numbers ...hroberts89436 wrote:this is a dump of a database. these are sales ranks I need to sort to know which is the better selling items.Villeroy wrote:How do 9000 numeric text values get into your spreadsheet? This does not happen by accident.Reminder this is after the sort of over 9,000 numbers why wont it sort properly
Code: Select all
10000075
1000011
10000687
100055
...I think that these are ID numbers of some items, similar to part numbers, zip codes and phone numbers.
Purposely, the database keeps these ID numbers as text and any decent application will import them as text. The text "123" is just a sequence of 3 characters that happen to be digits. Just like the sequence "ABC" the sequence "123" has no numeric value at all.
"0123" is another sequence than "123". Contrary to the text "0123", the number 0123 (formatted with leading zero) is exactly the same numeric value as number 123.
Still you did not anwer how the values get into the spreadsheet.
You can tell the database to export integer numbers (... CAST("ID", INT) AS "IDNUM" ...).
If the database dump is a text file you can import the column as numbers.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
hroberts89436
- Posts: 9
- Joined: Wed Dec 07, 2011 7:00 am
Re: Sort Data Numerically
Villeroy wrote:
Still you did not answer how the values get into the spreadsheet.
OK so I turned on highlighting. Yes you are correct even though I keep telling the system they are numbers they are staying text. how can I force them to be numbers? These are numbers that go from 1 to 9,999,999, and 0(zero).
I download an xls spreadsheet from my database on a server that has columns to CW and rows to 9,136 (and grows everyday). I want to sort them by sales rank so I can remove items above a specific rank from my database (this means they aren't selling)
Open Office Version 3.3.0 on windows XP Pro SP3
-
hroberts89436
- Posts: 9
- Joined: Wed Dec 07, 2011 7:00 am
Re: Sort Data Numerically
I just noticed that in the input line there is an apostrophe before the number, how can I easily remove that? I remove it manually and it converts to a number, but to do this to over 9000 rows a couple of times a week would not work.
OK here is a strange thing, I just opened it in Office 2007, and it opened properly as numbers, so how can I get open office to accept it?
OK here is a strange thing, I just opened it in Office 2007, and it opened properly as numbers, so how can I get open office to accept it?
Open Office Version 3.3.0 on windows XP Pro SP3
Re: Sort Data Numerically
The apostrophe prevent the interpretation of the string as number because the source data were text. If you would tell us how the data get into the sheet, we could tell you how to import the numeric text as values.
The conversion of wrong data goes like this:
1. Select the column.
2. Format>Cells... set any number format you'd like to see but not "@" of category Text
3. Edit>Find>Replace
[More Options]
[X] Current selection only
[X] Regular expressions
Search .+ (dot and plus)
Replace &
[Replace All]
Basically this retypes all values.
The conversion of wrong data goes like this:
1. Select the column.
2. Format>Cells... set any number format you'd like to see but not "@" of category Text
3. Edit>Find>Replace
[More Options]
[X] Current selection only
[X] Regular expressions
Search .+ (dot and plus)
Replace &
[Replace All]
Basically this retypes all values.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
hroberts89436
- Posts: 9
- Joined: Wed Dec 07, 2011 7:00 am
Re: Sort Data Numerically
I don't know how the data gets into the spreadsheet, I ask the system to download my inventory, I then get an email telling me the file is ready to be picked up, and then I click on the link and download the file.
Ok I tried your solution, cutting and pasting from your post into find and replace the items, I get the message: Search key not found, Im assuming that the symbol in replace is the ampersand, that is what it converted to.
Ok I don't know if it uploaded, I tried to upload the file
Ok I tried your solution, cutting and pasting from your post into find and replace the items, I get the message: Search key not found, Im assuming that the symbol in replace is the ampersand, that is what it converted to.
Ok I don't know if it uploaded, I tried to upload the file
Open Office Version 3.3.0 on windows XP Pro SP3
-
hroberts89436
- Posts: 9
- Joined: Wed Dec 07, 2011 7:00 am
Re: Sort Data Numerically
OK well I solved it, I used Crappy ass microsoft excel, selected the column, right clicked and selected convert to number. I then saved the file and opened it in open office and it now shows as a number, and sorts correctly. Does Libre Office or Open Office have this functionality? Why can't it be this simple in these apps? I would rather not have to ever touch Office, but it seems that Open Office and Libre Office are so far behind in some things that I will have to keep Microsoft products around.
Open Office Version 3.3.0 on windows XP Pro SP3
-
hroberts89436
- Posts: 9
- Joined: Wed Dec 07, 2011 7:00 am
Re: Sort Data Numerically
OK here is a link to the file: http://db.tt/j76rdksm
If someone can tell me how to convert these columns to numbers without using the stupid microsoft products I'd appreciate it. I'm mostly interested in Column A and CE
| Edit: 2024-02-20 Broken link -- MrProgrammer, forum moderator |
Last edited by robleyd on Wed Feb 21, 2024 8:57 am, edited 2 times in total.
Reason: Report broken link; disable live link
Reason: Report broken link; disable live link
Open Office Version 3.3.0 on windows XP Pro SP3
Re: Sort Data Numerically
hroberts89436 wrote:OK well I solved it, I used Crappy ass microsoft excel, selected the column, right clicked and selected convert to number.
...
Does Libre Office or Open Office have this functionality?
- Select the column
- menu Data > Text to column
- changes nothing in the dialog box, press OK
LibreOffice 6.4.5 on Windows 10
-
hroberts89436
- Posts: 9
- Joined: Wed Dec 07, 2011 7:00 am
Re: Sort Data Numerically
Gerard..... You are a genius. That worked perfectly. So simple and yet so working.
Thank you very much
Thank you very much
Open Office Version 3.3.0 on windows XP Pro SP3
Re: [Solved] Sort Data Numerically
THANK YOU,
Bernadine
OpenOffice 3.4.1 on Windows 8
Re: [Solved] Sort Data Numerically
Please update your signature (and/or upgrade your office suite). The (A)OO3.4.1 is an achaic old version.OpenOffice 3.4.1 on Windows 8
It is better to install LibreOffice today.
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: [Solved] Sort Data Numerically
yeah, I was crying today about stupid sort. but whaht exactly do you mean "this solved it"? what is "this".Bernadine wrote: ↑Thu Jan 12, 2023 4:57 amI was on the verge of tears, why wouldn't Open Office sort a simple list of numbers 1 to 30? No matter what I tried all I got was 1's then 2's. This solved it so easy. Going to save your answer in several places so I never lose how to do this.
THANK YOU,![]()
Bernadine
OpenOffice 4.1.2 on windows 7 spk1
Re: [Solved] Sort Data Numerically
I suppose "this" is the following:
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.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: [Solved] Sort Data Numerically
Yes, this is this:
"Select the column
menu Data > Text to column
changes nothing in the dialog box, press OK"
I thought I was replying to the post with those instructions in it, but these posts seem to get all crunched up and maybe I didn't. I don't know, very confused except by quoted answer.
"Select the column
menu Data > Text to column
changes nothing in the dialog box, press OK"
I thought I was replying to the post with those instructions in it, but these posts seem to get all crunched up and maybe I didn't. I don't know, very confused except by quoted answer.
OpenOffice 3.4.1 on Windows 8