Transform time in minutes
Comments
-
Hi David,
Can you share the sheet or some screenshots so that I can get a better understanding of your set up?
Have a fantastic week!
Best,
Andrée Starå
Workflow Consultant @ Get Done Consulting
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E: [email protected] | P: +46 (0) - 72 - 510 99 35
Feel free to contact me about help with Smartsheet, integrations, general workflow advice, or something else entirely.
0 -
Try This:
Where [email protected] is the Column that contains the time
=VALUE(LEFT([email protected], FIND("h", [email protected], 1) - 1)) * 60 + VALUE(MID([email protected], FIND("h", [email protected], 1) + 1, 2))
In Summary..
1. We find the "h"
FIND("h", [email protected], 1)2. We Take the text to the left **remember that it returns where the h is so we need to delete one value
LEFT([email protected], FIND("h", [email protected], 1) - 1))3. Rember it is text so change it to a value
VALUE(LEFT([email protected], FIND("h", [email protected], 1) - 1))4. Multiply it by 60 for minutes
VALUE(LEFT([email protected], FIND("h", [email protected], 1) - 1)) * 60
Now add the minutes to itA. We find the text after the "h"
FIND("h", [email protected], 1)B. We Take the text to the right
**remember that it returns where the h is so we need to add one value
**I am also taking 2 characters
MID([email protected], FIND("h", [email protected], 1) + 1, 2)C. Rember it is text so change it to a value
VALUE(MID([email protected], FIND("h", [email protected], 1) + 1, 2))
Add 4 to CThere is no error checking and if I was writing this for Excel it would probably fail but it seems that the error checking within Smartsheet seems to catch it
Ex. If it is 2h5 minutes even thought I am asking for 2 characters in B it returns 5 not "50"
would need a length function in B to deal with h120 or more.
0 -
Because I couldn't leave it alone
Where [email protected] is the Column that contains your time
=VALUE(LEFT([email protected], FIND("h", [email protected], 1) - 1)) * 60 + VALUE(MID([email protected], FIND("h", [email protected], 1) + 1, LEN([email protected]) - FIND("h", [email protected], 1)))I put a more detailed description and am waiting for it to be approved but this will also work for h120, 2h90, 0.5h, etc...
Brent C. Wilson
0 -
Hi Brent thanks a lot for the answer. It works fine at 95%
For example, 0h15 = 15 minutes, and it returns a 0
and 18h00 returns an #invalid value
(or if it's easier, i have a time column and also an hour and minutes column)
thanks
0 -
Not sure if i replied to you on my last reply or i did a simple reply
0 -
You should just be able to run the formula on the single 'Travel Time' column.
=VALUE(LEFT([Temps des traveaux]1, FIND("h", [Temps des traveaux]1, 1) - 1)) * 60 + VALUE(MID([Temps des traveaux]1, FIND("h", [Temps des traveaux]1, 1) + 1, LEN([Temps des traveaux]1) - FIND("h", [Temps des traveaux]1, 1)))
It works for me with no issues..
The key in this formula is that it looks for the 'h' and determines the numbers to the left are hours and the numbers to the right are minutes.
As you can see below
0