[Solved] Trouble Sorting Numbers in a Range Left to Right
[Solved] Trouble Sorting Numbers in a Range Left to Right
I have three columns with a one digit number in each row or each column. I am trying to sort the rows left to right by numerical order. If I select a single row>sort>options>left to right>by the row I have selected it works perfectly. If I select the range of rows I want to sort and preform the same operations then it gives me the option to select one of many rows to sort by, but no matter which row I choose to sort by it will not sort the entire range. It appears to do nothing. I am a new user to spreadsheets,I have only used Calc. I feel like I have overlooked something simple,or there is a simple solution.
- Attachments
-
- Example.ods
- (9.41 KiB) Downloaded 83 times
Last edited by robleyd on Mon Jul 15, 2019 2:40 pm, edited 1 time in total.
Reason: Tagged [Solved]
Reason: Tagged [Solved]
OpenOffice 4.1.6 on Windows 10
Re: Trouble Sorting Numbers in a Range Left to Right
The question is what you want to achieve. Normally, you put data that belongs together in a row, not in a column. That's how databases are designed. In a Calc list of your contacts, the name, address, telephone number, etc, for each contact would appear in a row, not a column. So if you want to use the sort routines in Calc, you should also put the data for each subject or object in a row, not a column. I don't know if there's an easy way to "mirror" your data from rows to columns.
OpenOffice 4.1.11 on Ubuntu; LibreOffice 6.4 on Linux Mint, LibreOffice 7.6.2.1 on Ubuntu
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
Re: Trouble Sorting Numbers in a Range Left to Right
The data in my example is in rows,it is a 3 digit number,each digit is in its own column on the same row. Some of the digits are out of order,I want to sort them from 0-9 I want 301 to display 013, 592 to display 259 for example. The program does what I want one row at a time,I just need to do 10,000 rows or more.floris v wrote:The question is what you want to achieve. Normally, you put data that belongs together in a row, not in a column. That's how databases are designed. In a Calc list of your contacts, the name, address, telephone number, etc, for each contact would appear in a row, not a column. So if you want to use the sort routines in Calc, you should also put the data for each subject or object in a row, not a column. I don't know if there's an easy way to "mirror" your data from rows to columns.
OpenOffice 4.1.6 on Windows 10
Re: Trouble Sorting Numbers in a Range Left to Right
Take a look at this attachment, which I sorted and let us know if this is what you would expect from your sample file.
If this is not what you would expect, then please upload another sample file, but include examples of what the data would look like after sorting.
If this is not what you would expect, then please upload another sample file, but include examples of what the data would look like after sorting.
- Attachments
-
- Example (7).ods
- (9.44 KiB) Downloaded 71 times
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.
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.
Re: Trouble Sorting Numbers in a Range Left to Right
Ok I see what you have done there,that sort did not reorder the digits in each row. That sort reordered the rows which I do not want,but we on the right track. You see the numbers were 3 digit strings,each digit has been separated into a column. I need each digit in its own column for other math I want to do to the numbers. But I need them to display in numerical order. example 864,648,468 are all the same number =468 in order. I manually sorted the rows in the attachment. Thanks for your help. I put sorted by row in the sheet by mistake,its row sorted by column I think.RusselB wrote:Take a look at this attachment, which I sorted and let us know if this is what you would expect from your sample file.
If this is not what you would expect, then please upload another sample file, but include examples of what the data would look like after sorting.
- Attachments
-
- Example.ods
- (10.21 KiB) Downloaded 73 times
OpenOffice 4.1.6 on Windows 10
Re: Trouble Sorting Numbers in a Range Left to Right
I understand now what it is you are looking for, unfortunately Calc doesn't have a built-in function that would do this for multiple rows.
You could use Data -> Sort, changing the Direction in the Options tab to Left to Right (Sort Columns), for each and every row, one at a time.
A macro might be a programmed option, but my knowledge in that area is limited.
You could use Data -> Sort, changing the Direction in the Options tab to Left to Right (Sort Columns), for each and every row, one at a time.
A macro might be a programmed option, but my knowledge in that area is limited.
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.
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.
Re: Trouble Sorting Numbers in a Range Left to Right
After two days of searching,and trying everything I could before posting here I am prepared to accept the answer is that the app just doesn't do that. If all three of the digits were in a string,in a cell could they be rearranged in the order I want? I combine the cells by =a1&b1&c1 for some of the math I am doing. I'm thinking of a formula that uses if and greater than to arrange them.RusselB wrote:I understand now what it is you are looking for, unfortunately Calc doesn't have a built-in function that would do this for multiple rows.
You could use Data -> Sort, changing the Direction in the Options tab to Left to Right (Sort Columns), for each and every row, one at a time.
A macro might be a programmed option, but my knowledge in that area is limited.
OpenOffice 4.1.6 on Windows 10
Re: Trouble Sorting Numbers in a Range Left to Right
Give it a few more days for some of the members that are more knowledgeable regarding macros to give their input. As I said, I think this can be done with a macro, but my lack of knowledge in the area means I'm unsure.
Personally I think trying to do this with a combined set would make the job even harder.
Doing it on a row by row basis is an option, it'd just take a while and be tedious....especially if you have lots of rows of data to work with.
Personally I think trying to do this with a combined set would make the job even harder.
Doing it on a row by row basis is an option, it'd just take a while and be tedious....especially if you have lots of rows of data to work with.
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.
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.
- MrProgrammer
- Moderator
- Posts: 4906
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Trouble Sorting Numbers in a Range Left to Right
Hi, and welcome to the forum.
If you want to replace the data in columns A-C, select D1:F20. Edit → Copy. Select A1:C20. Edit → Paste Special → ☐Paste All → ☑Numbers → ☐Formuas → OK. You can now delete columns D-F.
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
These instructions are based on your attachment. In D1, put =MIN(A1:C1). In E1 put =MEDIAN(A1:C1), In F1 put =MAX(A1:C1). Fill the formulas down the column. Columns D-F now contain the sorted numbers in each row.Deese wrote:I have three columns with a one digit number in each row or each column. I am trying to sort the rows left to right by numerical order.
If you want to replace the data in columns A-C, select D1:F20. Edit → Copy. Select A1:C20. Edit → Paste Special → ☐Paste All → ☑Numbers → ☐Formuas → OK. You can now delete columns D-F.
[Tutorial] Ten concepts that every Calc user should knowDeese wrote:I am a new user to spreadsheets,I have only used Calc.
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Trouble Sorting Numbers in a Range Left to Right
in one formula dragged across and down
i see MrProgrammer beat me to it but i thought i would add it anyway
Code: Select all
=SMALL($A1:$C1;COLUMN(A1))
- Attachments
-
- Deese.ods
- (10.07 KiB) Downloaded 92 times
OpenOffice 4.1.2 on Windows 7
If your question has been answered please add [solved] to the title by using the edit button at your first post
If your question has been answered please add [solved] to the title by using the edit button at your first post
Re: Trouble Sorting Numbers in a Range Left to Right
Yes thank you all, before I left for the day yesterday I figured out the =small way and was able to sort them. How do I mark this as solved?
OpenOffice 4.1.6 on Windows 10