Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-17-2015, 01:35 AM
Sekerob Sekerob is offline Convert large seconds values to a time format fails with #Value Windows 8 Convert large seconds values to a time format fails with #Value Office 2013
Novice
Convert large seconds values to a time format fails with #Value
 
Join Date: Jul 2015
Posts: 6
Sekerob is on a distinguished road
Exclamation Convert large seconds values to a time format fails with #Value

Working with a volunteer distributed computing project that provides it's time keeping data in seconds. This is pulled into Excel 2013 and then converted to a y:ddd:hh:mm:ss notation. In using the format d:hh:mm:ss as intermediate step to get to the object format of years:days:hours:minutes:seconds, find that any value over 255611462399 seconds evaluates to #Value i.e. the maximum working number is 8105:140:23:59:59. An example of large number is shown on this web page of mapping cancer markers which has accumulated 160,000 years computing time as of this post: https://secure.worldcommunitygrid.or...ShortName=mcm1



The formula used [with semicolon as separators] is

INT(E7/SecYr)&":"&RIGHT("00"&INT(MOD(E7;SecYr)/SecDay);3)&":"&TEXT(E7/SecDay;"hh:mm:ss")

To overcome this [bug/limit], am using a much convoluted formula that e.g. converts 407140107951 seconds [in H7] to 12910:119:18:25:51 with

INT(H7/SecYr)&":"&RIGHT("00"&INT(MOD(H7/SecYr;1)*365);3)&":"&RIGHT("0"&INT(MOD(H7/SecHr;24));2)&":"&RIGHT("0"&INT(MOD(H7/60;60));2)&":"&RIGHT("0"&MOD(H7;60);2)

The variables such as SecYr, SecDay and SecHr speak for themselves, e.g. SecHr being 3600 seconds, where MOD is used to compute the residuals for each of the time parts.

Is there any better way or a fix to this issue underway in a future excel release?

Thx
Reply With Quote
  #2  
Old 07-17-2015, 09:57 PM
macropod's Avatar
macropod macropod is offline Convert large seconds values to a time format fails with #Value Windows 7 64bit Convert large seconds values to a time format fails with #Value Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For a value in A1, you could use:
Code:
=TEXT(INT(A1/(86400*365)),"00 ")&TEXT(MOD(INT(A1/86400),365),"00 ")&TEXT(MOD(INT(A1/3600),24),"00:")&TEXT(MOD(INT(A1/60),60),"00:")&TEXT(MOD(A1,60),"00")
or, more precisely, to take account of leap years:
Code:
=TEXT(INT(A1/(86400*365.2425)),"00 ")&TEXT(MOD(INT(A1/86400),365.2425),"00 ")&TEXT(MOD(INT(A1/3600),24),"00:")&TEXT(MOD(INT(A1/60),60),"00:")&TEXT(MOD(A1,60),"00")
As for what features MS might add to a future Excel release, your crystal ball is as good as anyone else's... That said, I don't see that the issue you're having problems with is related to a limitation of Excel; rather, it's a limitation of the formula you're using.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 07-17-2015 at 10:03 PM. Reason: Formula revision
Reply With Quote
  #3  
Old 07-18-2015, 10:02 AM
Sekerob Sekerob is offline Convert large seconds values to a time format fails with #Value Windows 8 Convert large seconds values to a time format fails with #Value Office 2013
Novice
Convert large seconds values to a time format fails with #Value
 
Join Date: Jul 2015
Posts: 6
Sekerob is on a distinguished road
Default

Thanks for your reply. Saw the mail notification earlier and played with your 'improved' version. Now it's 146 char long from before 160 and substituted the old whereever it showed in the workbooks.

Bug or feature, I've been unable to derive where 255611462399 seconds might have been coming from.

Pity your MS MVP crystal ball is as hazy as mine with regards to what's being fixed. Maybe I'll have a look at the OF2015 test release. Curious is, if using d:hh:mm:ss as text mask, the feedback value is 31:23:59:59 or 32 days minus 1 second. Did not find [d]:hh:mm:59 as working. Pity as that would have allowed to reuse the days determined... 2958100 it seems.

Anyway, Thx again.
Reply With Quote
  #4  
Old 07-18-2015, 01:56 PM
macropod's Avatar
macropod macropod is offline Convert large seconds values to a time format fails with #Value Windows 7 64bit Convert large seconds values to a time format fails with #Value Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Sekerob View Post
I've been unable to derive where 255611462399 seconds might have been coming from.
Doubtless it's in your data - Excel wouldn't just create it out of thin air..

Here's some simplified formulae:
Code:
=TEXT(INT(A1/(86400*365)),"00 ")&TEXT(MOD(INT(A1/86400),365),"00 ")&TEXT(MOD(A1,86400)/86400,"hh:mm:ss")
and, for greater precision:
Code:
=TEXT(INT(A1/(86400*365.2425)),"00 ")&TEXT(MOD(INT(A1/86400),365.2425),"00 ")&TEXT(MOD(A1,86400)/86400,"hh:mm:ss")
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
time format

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert alphabets to numeric values kjxavier Word 3 07-06-2014 05:34 AM
Convert numeric values with decimals to alphabets kjxavier Word 1 07-06-2014 01:44 AM
Convert large seconds values to a time format fails with #Value PDF converter fails to convert equations Jennifer Murphy Word 3 01-12-2012 02:57 PM
Adding a long column of time increments in seconds klippert Excel 1 09-18-2010 12:26 AM
Is there a way to change the header in a large amount of documents at one time? ntsstaffing Word 1 07-11-2009 12:12 PM

Other Forums: Access Forums

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


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