cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert Text Time into Time Format

Former Member
0 Likes
1,817
Start Time (Text)Required
00:08:058:05 AM
00:08:128:12 AM
00:08:178:17 AM
View Entire Topic
Former Member
0 Likes

Use this:

=ToDate("20160101"+Right([Start Time];5);"yyyyMMddHH:mm")

Copy and paste or type it exactly - it will give you a date/time field

Then right-click on the cell that you are using it in and format the number to fit the date/time format that you require above.

Former Member
0 Likes

Thanks for your Support.

Could you please help me in another issue i am facing

CodeDateStart_Time
F319018/15/20169:04:00 AM
F319018/15/20169:32:00 AM
F319028/15/201610:40:00 AM
F319028/15/201611:10:00 AM
F319028/15/201611:19:00 AM
F319038/15/201611:41:00 AM
F319038/15/201612:04:00 PM
F319038/15/201612:17:00 PM
F319038/15/201612:24:00 PM
F319038/15/2016

12:30:00 PM

Required Result

CodeDateMin TimeMax Time
F319018/15/20169:04:00 AM9:32:00 AM
F319028/15/201610:40:00 AM11:19:00 AM
F319038/15/201611:41:00 AM12:30:00 PM
amitrathi239
Active Contributor
0 Likes

try with these steps.

Min Time=FormatDate(Min([Start_Time]) In ([Code]);"HH:mm:ss a")

Max Time=FormatDate(Max([Start_Time]) In ([Code]);"HH:mm:ss a")

Make sure your Start_Time object datatype is Date.if Start_time is string data type then first convert in the date data type.


use these if data type is string.


Min Time=FormatDate(Min(ToDate([Start_Time];"HH:mm:ss a")) In ([Code]);"HH:mm:ss a")

MaxTime=FormatDate(Min(ToDate([Start_Time];"HH:mm:ss a")) In ([Code]);"HH:mm:ss a")


Former Member
0 Likes

Thanks Man. you are great.

Now i want average of time but due to data type as string i cant take average.

L01 ASM Long NameMinMax
460 : MUHAMMAD RIZWAN SHAHID09:49:0018:19:00 PM
460 : MUHAMMAD RIZWAN SHAHID08:39:0017:46:00 PM
460 : MUHAMMAD RIZWAN SHAHID08:27:0020:07:00 PM
460 : MUHAMMAD RIZWAN SHAHID08:48:0018:52:00 PM

Result Required

L01 ASM Long NameAvg of MinAvg of Max
460 : MUHAMMAD RIZWAN SHAHID9:20:14 AM6:02:28 PM
amitrathi239
Active Contributor
0 Likes

try with these steps.

First you need to convert string time to date and then in secs.

Secs=Average(ToNumber(FormatDate(ToDate([Max] ;"HH:mm:ss a");"HH")) * 3600 +

ToNumber(FormatDate(ToDate([Max] ;"HH:mm:ss a");"mm")) * 60 +

ToNumber(FormatDate(ToDate([Max] ;"HH:mm:ss a");"ss"))

)

with above Secs variable you will get the average in seconds.

Next is convert the seconds in hh:mm:ss.

=FormatDate(ToDate(Concatenation(Concatenation(Concatenation(Concatenation(FormatNumber(Floor([Secs]/3600);"00"); ":" ); FormatNumber(Floor(Mod([Secs];3600)/60) ;"00")); ":" ); FormatNumber(Mod(Mod([Secs];3600) ;60) ;"00"));"HH:mm:ss a");"hh:mm:ss a")


Former Member
0 Likes

Dear Amit,

Thanks for you support.

I have applied your given formulas and get correct result. but there is an issue with formula . creating "#ERROR" because there are some blanks.

amitrathi239
Active Contributor
0 Likes

before calculating the average replace null values with 00:00:00 and try.

like

=if(isnull([Min_Time])) thne "00:00:00 AM" else [Min_Time]

Former Member
0 Likes

Keep it simple. Use these for your Start and End time

=Max([Start Time]) in ([Code])

=Min([Start Time]) in ([Code])

Then format them how you want (as advised in the answer of mine that you marked as correct earlier) with right click, format (cell or number, depending which Webi type you are using).

Former Member
0 Likes

Hi Amit,

Again I need your expertise.

SMPSOCodeDateStart_TimeEnd_TimeTIO
ARSHAD AMIR7L10152007497/1/20164:35 PM8:37 PM4:02
ARSHAD AMIR7L10152007497/1/20166:10 PM10:10 PM4:00
ARSHAD AMIR7L10152007617/1/201610:24 AM2:45 PM4:21
ARSHAD AMIR7L10152007627/2/20163:58 PM7:30 PM3:32
ARSHAD AMIR7L10152016677/2/20163:55 PM6:57 PM3:02
ARSHAD AMIR7L10152022617/2/20164:27 PM5:30 PM1:03
SHOAIB KHALIQ8L10153007497/1/20165:35 PM8:37 PM3:02
SHOAIB KHALIQ8L10163007507/1/20165:10 PM10:10 PM5:00
SHOAIB KHALIQ8L10173007517/1/20169:24 AM2:45 PM5:21
SHOAIB KHALIQ8L10183007527/2/20164:58 PM7:30 PM2:32
SHOAIB KHALIQ8L10193007537/2/20164:55 PM6:57 PM2:02
SHOAIB KHALIQ8L10203007547/2/20163:27 PM5:30 PM2:03

Result Required.

SMAvg TIO
ARSHAD AMIR
SHOAIB KHALIQ

I need Average at "SM" level "Average of (Sum(TIO) by PSO & Date) "Firstly Sum "TIO" by PSO & Date Then Average.

Please guide

amitrathi239
Active Contributor
0 Likes

Plz start a new discussion as this is already closed.Instead of putting multiple questions in single always start a new discussion...

If you will drag SM and TIO in the table are you not getting the desired results?