Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Bob is offline
external usenet poster
 
Posts: 972
Default How do I convert a number in Excel such as 1001-1 to 1001-01?

I have several hundred numbers in my Excel file that need to be converted as
noted in the subject. The sorting is awkward in that 1001-11 sorts before
1001-2 and is obviously out of order- at least for my purposes.
--
SgtBob
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default How do I convert a number in Excel such as 1001-1 to 1001-01?

These aren't numbers to Excel, they're text. So you do something like this:
=if(len(a1)=6,left(a1,5)&"0"&right(a1,1),a1)

Regards,
Fred

"Bob" wrote in message
...
I have several hundred numbers in my Excel file that need to be converted
as
noted in the subject. The sorting is awkward in that 1001-11 sorts before
1001-2 and is obviously out of order- at least for my purposes.
--
SgtBob


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default How do I convert a number in Excel such as 1001-1 to 1001-01?

=LEFT(A1,FIND("-",A1)-1) & "-" & TEXT(MID(A1,FIND("-",A1)+1,10),"00")

If this post helps click Yes
---------------
Jacob Skaria


"Bob" wrote:

I have several hundred numbers in my Excel file that need to be converted as
noted in the subject. The sorting is awkward in that 1001-11 sorts before
1001-2 and is obviously out of order- at least for my purposes.
--
SgtBob

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default How do I convert a number in Excel such as 1001-1 to 1001-01?

Here's another formula to try out...

=IF(MID(A1,LEN(A1)-1,1)="-",SUBSTITUTE(A1,"-","-0"),A1)

--
Rick (MVP - Excel)


"Bob" wrote in message
...
I have several hundred numbers in my Excel file that need to be converted
as
noted in the subject. The sorting is awkward in that 1001-11 sorts before
1001-2 and is obviously out of order- at least for my purposes.
--
SgtBob


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
HOW DO I SORT NUMBERS WITH TEXT EX 1000 1001 1000A Rusty Excel Discussion (Misc queries) 5 May 19th 08 02:28 PM
From 1001 to 1001-1 Steved Excel Worksheet Functions 2 May 23rd 06 04:01 AM
convert text-format number to number in excel 2000%3f Larry Excel Discussion (Misc queries) 1 July 29th 05 08:18 PM
convert decimal number to time : convert 1,59 (minutes, dec) to m agenda9533 Excel Discussion (Misc queries) 8 January 20th 05 10:24 PM
Event 1001 & 1004 Andy Excel Discussion (Misc queries) 0 November 29th 04 04:43 PM


All times are GMT +1. The time now is 06:48 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"