Need help sorting numbers in Excel

  • Thread starter Thread starter Dennis M
  • Start date Start date
D

Dennis M

I have a text file with 1,163 lines of all the files on my website. Each
line begins with a number of hits that that page has received and has
anywhere from 0 to 5 digits, then the name of the file.

I'd like to be able to sort this file in Excel (for Mac, v. 4.0) by the
page with the highest number of hits to the page with the lowest number of
hits. I was able to play around with the Excel sort tool, but I got, for
example...

1000
1001
1002
1003
10057
10062
1007
1009
101
102

.....instead of what I'm looking for:

101
102
1000
1001
1002
1003
1007
1009
10057
10062

It seems like surely there would be a way to accomplish this in Excel, but
unfortunately I'm not familiar enough with the program and I didn't see any
reference to this task in its help. TIA for any advice.

--
_--_ "I don't need your war machine,
/ `--''> ,,, I don't need your ghetto scenes."
| / I I |||||||||[:::]
\ oo ,-._> ''' Super Seventies RockSite!
`--' http://www.superseventies.com/
 
Hi

If you haven't already done so, I suggest you strip the number bit away from
the name of the file.
Alongside your data use something like:
=VALUE(LEFT(A2,FIND(" ",A2)-1))
This will give you the number bit, which you can sort on, as it is now a
number and not text.
 
Dennis M said:
I have a text file with 1,163 lines of all the files on my website. Each
line begins with a number of hits that that page has received and has
anywhere from 0 to 5 digits, then the name of the file.

I'd like to be able to sort this file in Excel (for Mac, v. 4.0) by the
page with the highest number of hits to the page with the lowest number of
hits. I was able to play around with the Excel sort tool, but I got, for
example...

1000
1001
1002
1003
10057
10062
1007
1009
101
102

....instead of what I'm looking for:

101
102
1000
1001
1002
1003
1007
1009
10057
10062

It seems like surely there would be a way to accomplish this in Excel, but
unfortunately I'm not familiar enough with the program and I didn't see any
reference to this task in its help. TIA for any advice.

That's because you have the cells formatted as something other than
"Number" (maybe "Text"). Select all the cells and tell Excel that
they're numbers (Format menu, Cells, then choose Number from the
Category list on the General tab).

Now, resort.
 
sbt said:
That's because you have the cells formatted as something other than
"Number" (maybe "Text"). Select all the cells and tell Excel that
they're numbers (Format menu, Cells, then choose Number from the
Category list on the General tab).

Now, resort.

Thank you very much, that did the trick (after I realized I needed to put
the numbers and the file names in separate columns!).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top