Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Sort to include hyphen

I'm having a problem with sorting my Data. When Excel does a sort, it
does not include hyphens. So MV-2 would come after MV1. But later,
when I try to import new data, I am doing a binary search. In this
search, MV-2, would be seen as less than MV1, because a '-' is less
than 1. Is there any way to do a quick sort that includes the '-' in
the search criteria?

Thanks,

Matt

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sort to include hyphen

How about using another column of cells with a formula in it and sort your range
on that.

The code for the hypen is 45 (=code("-"))
The code for a dot is 46 (=code("."))

Maybe:
=substitute(a1,"-",".")

It may cause some confusion if you have items like MV-1 and MV.1, though.

mcolson wrote:

I'm having a problem with sorting my Data. When Excel does a sort, it
does not include hyphens. So MV-2 would come after MV1. But later,
when I try to import new data, I am doing a binary search. In this
search, MV-2, would be seen as less than MV1, because a '-' is less
than 1. Is there any way to do a quick sort that includes the '-' in
the search criteria?

Thanks,

Matt


--

Dave Peterson
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
Sort Room Numbers that include Alphabetes Sort by Room and ABC Excel Worksheet Functions 1 August 4th 07 12:52 AM
How do you change sort defaults for combined text number & hyphen. Anna Excel Discussion (Misc queries) 1 April 8th 05 05:01 AM
sort cells with hyphen #####-###-#### bagman Excel Discussion (Misc queries) 6 January 1st 05 07:05 PM
sort cells with hyphen #####-###-#### infurtaris Excel Discussion (Misc queries) 0 January 1st 05 05:15 PM
Why does sort always default to include a header row. I want the. Jim Grace Excel Programming 1 September 23rd 04 11:13 PM


All times are GMT +1. The time now is 07:32 AM.

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"