Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default number formatting help

I am needing some help in formatting numbers with a - as a divider.
Most numbers are 123456-0123, but I would like to not show the leading
0 after the -

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 492
Default number formatting help

I don't think you can do it with formatting but you can with a formula, one
way would be
=IF(A1<0,LEFT(A1,FIND("-",A1))&RIGHT(A1,LEN(A1)-FIND("-",A1)-1),"")
then copy paste special values to lose the formulas,
Regards,
Alan.
wrote in message
ups.com...
I am needing some help in formatting numbers with a - as a divider.
Most numbers are 123456-0123, but I would like to not show the leading
0 after the -


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default number formatting help

How can I ignore the 0 if there are 2 after the hyphen. Ex 123.0012

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default number formatting help

Do you want to convert 123456-0012 to 123456.12?

As text:
=IF(A1<0,LEFT(A1,FIND("-",A1)-1)&"."&--(MID(A1,FIND("-",A1)+1,255)))



dysart316 wrote:

How can I ignore the 0 if there are 2 after the hyphen. Ex 123.0012


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 492
Default number formatting help

Hi Dave,
Good one but could you please explain how that works? I know it does as I
tried it but I don't understand how it removes any number of leading zero's.
It has to be the +1,255 that does it, but how?
Regards,
Alan.
"Dave Peterson" wrote in message
...
Do you want to convert 123456-0012 to 123456.12?

As text:
=IF(A1<0,LEFT(A1,FIND("-",A1)-1)&"."&--(MID(A1,FIND("-",A1)+1,255)))



dysart316 wrote:

How can I ignore the 0 if there are 2 after the hyphen. Ex 123.0012


--

Dave Peterson




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 620
Default number formatting help

MID() is a string manipulation function. Look in help to see what the
parameters of the function are.
-- is a double unary minus, which converts the string to a number (and in
doing so it will lose leading zeroes).
& is the concatenate operator.
--
David Biddulph

"Alan" wrote in message
...
Hi Dave,
Good one but could you please explain how that works? I know it does as I
tried it but I don't understand how it removes any number of leading
zero's. It has to be the +1,255 that does it, but how?
Regards,
Alan.
"Dave Peterson" wrote in message
...
Do you want to convert 123456-0012 to 123456.12?

As text:
=IF(A1<0,LEFT(A1,FIND("-",A1)-1)&"."&--(MID(A1,FIND("-",A1)+1,255)))



dysart316 wrote:

How can I ignore the 0 if there are 2 after the hyphen. Ex 123.0012


--

Dave Peterson




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default number formatting help

And the +1 moves one character to the right of the hyphen.

And the 255 was just a big enough number to retrieve a bunch of characters. I'm
betting that your strings don't approach that length!

Alan wrote:

Hi Dave,
Good one but could you please explain how that works? I know it does as I
tried it but I don't understand how it removes any number of leading zero's.
It has to be the +1,255 that does it, but how?
Regards,
Alan.
"Dave Peterson" wrote in message
...
Do you want to convert 123456-0012 to 123456.12?

As text:
=IF(A1<0,LEFT(A1,FIND("-",A1)-1)&"."&--(MID(A1,FIND("-",A1)+1,255)))



dysart316 wrote:

How can I ignore the 0 if there are 2 after the hyphen. Ex 123.0012


--

Dave Peterson


--

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
Auto Formatting Custom Number CSBUG Excel Discussion (Misc queries) 4 November 17th 05 07:57 PM
Text Function with Different Formatting for Number MKenworthy Excel Discussion (Misc queries) 1 September 1st 05 11:34 PM
concatenating and formatting area code and phone number columns sherri Excel Worksheet Functions 4 September 1st 05 09:59 PM
Pivot Table Drill Down Number Formatting Gregg Riemer Excel Discussion (Misc queries) 1 January 4th 05 10:53 PM
Conditional Formatting (Date vs Number) [email protected] Excel Discussion (Misc queries) 7 December 20th 04 10:23 PM


All times are GMT +1. The time now is 06:20 AM.

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

About Us

"It's about Microsoft Excel"