Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2014, 08:47 AM
ironsand ironsand is offline Problem with Excel number masks Windows 7 64bit Problem with Excel number masks Office 2010 64bit
Novice
Problem with Excel number masks
 
Join Date: Oct 2014
Posts: 3
ironsand is on a distinguished road
Default Problem with Excel number masks

Morning!
I'm experiencing a hard time trying to figure out a number format mask in Excel. The number format is quite simple: just numbers, dots and a hyphen. The format is: 0003475-09.2014.8.05.0001 (7 numbers, hyphen, 2 numbers, dot, 4 numbers, dot, 1 number, dot, 2 numbers, dot, 4 numbers).

I put the following mask in Excel:
0000000-00"."0000"."0"."00"."0000

Here is the trick: Excel put the number in the given mask, but it always changes the 2 last numbers to zeroes ("00").

E.g., if I feed the number 00034750920148059987, I get back the result 0003475-09.2014.8.05.9900. If I feed the number 00034750920148054567, the result is 0003475-09.2014.8.05.4500.



Can somebody help me, please?
Reply With Quote
  #2  
Old 11-01-2014, 12:15 PM
excelledsoftware excelledsoftware is offline Problem with Excel number masks Windows 7 64bit Problem with Excel number masks Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

very peculiar. It seems that a custom format like that always wants to end with 2 zeroes. Must have something to do with Scientific Notation. If is possible to do what you want using cells formatted as text and then the following formula in a corresponding cell.
Code:
=MID(G1,1,7)&"-"&MID(G1,8,2)&"."&MID(G1,10,4)&"."&MID(G1,14,1)&"."&MID(G1,15,2)&"."&RIGHT(G1,4)
Now of course I put the number in G1 put you can put the value where you want and then change the formula accordingly.

Sorry this isnt exactly what you are looking for but we could also write a VBA script which will keep it in the same cell after you process the code or on worksheet change. Lots of options here.

Thanks
Reply With Quote
  #3  
Old 11-23-2014, 08:43 AM
ironsand ironsand is offline Problem with Excel number masks Windows 7 64bit Problem with Excel number masks Office 2010 64bit
Novice
Problem with Excel number masks
 
Join Date: Oct 2014
Posts: 3
ironsand is on a distinguished road
Smile I'm still curious, but thanks!

Though it is not exactly what I wanted, it will work. I just have to adjust the formula a little to fill the leading zeroes, but it is no problem.
This solution answer my need, but my curiosity really thrives to understand what does lead excel to the original misinterpretation.
Thanks for your time! Your answer is a fair solution to my problem!
Reply With Quote
  #4  
Old 11-23-2014, 09:29 AM
Catalin.B Catalin.B is offline Problem with Excel number masks Windows Vista Problem with Excel number masks Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

Hi,
On Excel, numbers must conform to IEEE 757 standards of 15 characters or less, any digit beyond 15 is replaced by "0".
That's why you need to treat numbers with more that 15 chars as text.
Reply With Quote
  #5  
Old 11-23-2014, 04:21 PM
ironsand ironsand is offline Problem with Excel number masks Windows 7 64bit Problem with Excel number masks Office 2010 64bit
Novice
Problem with Excel number masks
 
Join Date: Oct 2014
Posts: 3
ironsand is on a distinguished road
Smile Thank you very much!

Ooooown!
Ok, now I understand.
Thank you for spending your time providing me a solution and an answer, guys.
Reply With Quote
Reply

Tags
number formatting



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Excel number masks Number List Problem! Mole Patrol Word 2 09-18-2013 11:46 AM
Problem with Excel number masks Mailing: how to make the "page number" in Word is the same as "row number" in excel w Jamal NUMAN Word 1 09-03-2011 11:37 AM
Problem with Excel number masks Page Number problem lugibson Word 3 08-12-2011 03:45 AM
Problem with Excel number masks Problem with of Number of pages ilkks Word 3 05-25-2011 02:27 PM
Number of lines on page problem JamesT Word 0 08-27-2009 04:52 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft