![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Waterdown, Ontario
Posts: 444
|
I have a column which has 2 types of numbers. One set is 4 digits (i.e. 1234) and the other set has a dash (i.e. 1234-001). When I try to use the Data--Sort function it places all the dashed numbers at the bottom as opposed to sorting them by the first 4 digits ,ie.
1234 1234-001 1234-002 1235 1235-001, etc. Instead, what is does is this; 1234 1235 1234-001 1234-002 1235-001 etc. Formatting the cells to number text, etc. does nothing. How do I fix this? |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: N.E. Ohio
Posts: 236
|
sometimes I have trouble formatting the cells to text after they are numbers. anyway, for a short list, put a single quote (') infront of the number ('1234).
for a long list, if data is in a2, in b2 put =clean(trim(a2)) copy down. sort on column b |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Why don't you do a replace, i.e. replace all "-" with ".", then sort and then replace back the "." with "-".
_________________ Hope this helps. Kind regards, Al. [ This Message was edited by: Al Chara on 2002-05-24 10:33 ] |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
Perhaps, the easiest solution to your data type conversion need is to select the cells containing your columnar data, choose the Data | Text to Columns... menu command, press [ Next> ] until you reach Step 3 of 3 of the wizard, choose the Text format option and press [ Finish ]. [ This Message was edited by: Mark W. on 2002-05-24 10:49 ] |
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Waterdown, Ontario
Posts: 444
|
Thx. I will try them all.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|