Plain Text to Duration conversion google sheets - time

I'm trying to set up a form where colleagues can input times and durations and other elements will auto-fill.
I've got the input converting plain text to time using:
=text(time(left(X4,2),right(X4,2),),"HH:mm AM/PM")
But haven't worked out how to do the same for duration (ideally inputting in minutes e.g. 90 equates to 01:30:00).
Thanks

First of all, your formula doesn't convert to time because the output of text is plain text. To get actual time, use time(left(X4,2),right(X4,2),) and format cells with this formula as HH:mm AM/PM.
Similarly for duration: if X4 has "90", then time(0,X4,0) will display the duration of 1:30:00 provided the cell is formatted as duration.

Related

Only allow whole numbers but display with '.' on the thousand for easy read

I want to apply data validation to my column so as to only accept whole numbers.
However I want these to be displayed with a dot so as to make it easier to read later on.
e.g. input = 14354 which is valid and then displayed 14.354
the data validation regular expression I am ussing is:
=regexmatch(to_text(A2);"^\d+\.*\d+$")
and the custom formatting is:
#,##
for most this working fine, large numbers are displayed with the '.' and things it shouldnt accept it is rejecting.
However, in the case of numbers which are entered with a decimal point as these are hidden, it is accepting it as valid.
It is also changing the format to auto atic and reading as date such entries like: 15.4
I should point out that I am using sheets in spanish and therefore the , is the marker for decimal places.
What am i missing here??
Select the cell range then go to Data > Data validation...
Add a custom formula rule:
=mod(A1;1)=0
Try this one:
=and(regexmatch(to_text(A2);"^\d+(\.\d{3})*$");mod(A2;1)=0)
Improved your formula to only accept a dot when it is followed by 3 numbers (this way, we invalidate the date e.g A2)
Combining the improved formula of yours and Aresvik's modulo answer, we need to check if the value does not have decimal. (this way, we invalidate the decimal e.g A6)
When both returns true, this shall confirm that the number inputted is a whole number with no decimal and not a date.
Output:
Invalid inputted values:
A2 - 15.4
A6 - 16412,212

How can I use a multiple line text as a prompt text for a report parameter

I want to use a long text with multiples line in the prompt text of one of my report report parameter. The text is something like :
"Minimum duration : Default value 0
This parameter is used to evaluate the time period when the report will be executed. (Today date - Minimum duration = Start Date)"
I didn't find any way to format the text prompt, it only show as a single line.
Is there any way to achieve this ?

How to format dd/mm/yy to dd-mon-yyyy in altova stylevision

I am new to Altova Stylevision. I need to format the date from dd/mm/yy to dd/Mon/yyyy.
I have tried the options suggested in the Altova manual but it does not seem to recognize the format.
This question is almost three weeks old, so maybe meanwhile you have found an answer, for instance by looking it up at page 781 of XSLT 2.0 and XPath 2.0 Programmer's Reference by Michael Kay. Or perhaps somewhere else on the web.
To achieve what you want in XSLT 2.0, we first need to convert your date-like string into international date-time notation. Luckily, we only need to care about the date-part, which should take the form YYYY-MM-DD.
After that, we "just" need to call format-date with the proper picture string:
<!-- first, convert your date into int'l date-notation with a regex -->
<xsl:variable
name="date"
select="replace('14/09/2014', '(\d+)/(\d+)/(\d+)', '$3-$2-$1')" />
<!-- then, use a properly formatted picture string to get the abbrev. month -->
<xsl:value-of
select="format-date(xs:date($date), '[D01]/[MNn,3-3]/[Y]')" />
The output with conforming processors like Saxon or Exselt (didn't try Altova) is this: 14/Sep/2014.
The picture string works as follows (from that same book I quoted):
[xxxx] is a variable marker
[D01] formats the day-part as a two-digit day (leave out the zero if you don't want leading zeroes)
[MNn,3-3] formats the month with M as case-word with Nn with a width of min three and max three with 3-3.
[Y] formats the year in the default format as a four-digit year.
If you need the full name of the month, remove the width-specifier. If you need some other output, check out the table in the XPath 3.0 specification for what you can use in the picture string.

HTML time tag - correct date format

I am wanting to use the correct format and standards to put the time tag in my html document.
Is this the correct way to do it?
<time datetime="2014-03-26T12:48:42.733Z">26/03/2014</time>
Thanks
The Format is YYYY-MM-DDThh:mm:ssTZD
The date or time being specified. Explanation of components:
YYYY - year (e.g. 2011)
MM - month (e.g. 01 for January)
DD - day of the month (e.g. 08)
T - a required separator if time is also specified
hh - hour (e.g. 22 for 10.00pm)
mm - minutes (e.g. 55)
ss - seconds (e.g. 03)
TZD - Time Zone Designator (Z denotes Zulu, also known as Greenwich Mean Time)
So Yes
Source
The time element as defined in HTML5 must specify time, date, time and date, or other applicable designation in a specific machine-readable format, as described in the draft. This designation may appear as the element content, e.g.
<time>2014-03-26></time>
If it does not (typically, when the content specifies a date or time in human-readable form in some language), the machine-readable designation must appear as the value of the datetime attribute, e.g.
<time datetime="2014-03-26">26/03/2014</time>
The notation in the question is not adequate, as the value of the attribute must be “a representation of the element's contents in a machine-readable format”, and a date and time denotation, down to milliseconds, can hardly be said to represent a date.
Note: There is no evidence of browsers or search engines making any use of time markup, so such markup is only potentially useful.
As per the specs:
A valid date-time as defined in [RFC 3339], with these additional qualifications:
the literal letters T and Z in the date/time syntax must always be uppercase
the date-fullyear production is instead defined as four or more digits representing a number greater than 0
Examples:
1990-12-31T23:59:60Z
1996-12-19T16:39:57-08:00
Yes, see RFC 3339 and input type=datetime
The spec here lays down the format. There's no mention of fractional time, so no - this is not correct.
However, this will be correct:
<time datetime="2014-03-26T12:48:42Z">26/03/2014</time>

How to prevent wrapping around of time when adding them in spreadsheet?

I have absolute values of time (as in stopwatch not date/time) in various cells and I would like to add them and keep them the same format (as an absolute value). I have formatted the cells using hh:mm:ss time format but when I add two values like:
22:34:00
4:00:00
I see: 2:34:00 because of wrapping around the 24-hour time format, instead of 26:34:00.
How can I do this with OO-Calc?
Well, the solution seemed to be to use the format, [HH]:MM:SS instead of HH:MM:SS.

Resources