Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
dzuy
 
Posts: n/a
Default Sorting: Sorting by the First Character

I'm looking to sort my data by looking at the first character only. Here's an
example data set:

21
100
4020
56
32

I want this data set to look like this:

100
21
32
4020
56

I think it may require some programming, but I'm not sure. And I haven't the
slightest idea on how to program. Can anyone help shed some light on my
issue? Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
Nick Hodge
 
Posts: n/a
Default Sorting: Sorting by the First Character

Use a 'helper' column and sort on that, say in D1, enter...(when your number
is in A1)

=LEFT(A1,1)

sort now on column D...(Not sure if this will make thinks unique enough or
not as you may need to use another column too for the second sort level.

If you need further numbers stripped from the data in other helper columns
use the MID function, like so (2nd character)

=MID(A1,2,1)

You may also find that formatting these numbers as text will work, but you
will not then be able to apply numeric functions to them (SUM, AVERAGE, Etc)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"dzuy" wrote in message
...
I'm looking to sort my data by looking at the first character only. Here's
an
example data set:

21
100
4020
56
32

I want this data set to look like this:

100
21
32
4020
56

I think it may require some programming, but I'm not sure. And I haven't
the
slightest idea on how to program. Can anyone help shed some light on my
issue? Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default Sorting: Sorting by the First Character

Insert a helper column to the right of the number and in the first row enter
the following formula:

=VALUE(LEFT(A1,1))

Then copy the formula down the column and sort your data on the helper
column results. After the sort you can delete the helper column

The Left function extracts the first character of the value, and the value
function converts it back to a number so you can sort it numerically.
--
Kevin Backmann


"dzuy" wrote:

I'm looking to sort my data by looking at the first character only. Here's an
example data set:

21
100
4020
56
32

I want this data set to look like this:

100
21
32
4020
56

I think it may require some programming, but I'm not sure. And I haven't the
slightest idea on how to program. Can anyone help shed some light on my
issue? Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting Sorting Sorting Skydiver Excel Discussion (Misc queries) 4 June 3rd 06 02:42 PM
Odd! Excel changes my letter character. Why? spygrrl Excel Discussion (Misc queries) 5 March 9th 06 03:53 PM
Count occurrence of character within a cell Kelli Excel Discussion (Misc queries) 2 January 18th 06 02:20 PM
Excel and access should permit sorting by last character Eriemaster Excel Worksheet Functions 0 July 29th 05 09:13 PM
Copy a column in worksheet with a character change photowiz Excel Worksheet Functions 1 February 5th 05 03:35 PM


All times are GMT +1. The time now is 03:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"