web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / convert x hours y minu...
Power Automate
Answered

convert x hours y minutes to x*60 +y minutes .

(0) ShareShare
ReportReport
Posted on by 14

Hi!

I have an excel sheet where I have on the col k row 1 "30 minutes" and col k row 2 "2 hours and 30 minutes" and I need to add them and convert them to only minutes. 

This program should work with more than 2 rows.

Thanks for the help! 

 

  • Verified answer
    UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    I have created Sample flow 

    pleaae try this

    UshaJyothi20_0-1701690618889.png

    and the code snippent is as given below 

    copy and paste in your PAD designer

     

    SET Time1 TO $'''30 minutes'''
    SET Time2 TO $'''2 hours and 30 minutes'''
    Text.ParseText.RegexParseForFirstOccurrence Text: Time1 TextToFind: $'''.*(?=\\shours)''' StartingPosition: 0 IgnoreCase: False Match=> Hours
    Text.ParseText.RegexParseForFirstOccurrence Text: Time1 TextToFind: $'''\\d{2}.*(?=minutes)''' StartingPosition: 0 IgnoreCase: False Match=> minutes
    Text.ToNumber Text: minutes Number=> TextAsNumber
    Text.ParseText.RegexParseForFirstOccurrence Text: Time2 TextToFind: $'''.*(?=\\shours)''' StartingPosition: 0 IgnoreCase: False Match=> Hours1
    Text.ParseText.RegexParseForFirstOccurrence Text: Time2 TextToFind: $'''\\d{2}.*(?=minutes)''' StartingPosition: 0 IgnoreCase: False Match=> Minutes1
    Text.ToNumber Text: Minutes1 Number=> TextAsNumber2
    SET AddHours TO (Hours + Hours1) * 60
    SET Addmin TO TextAsNumber + TextAsNumber2
    SET FinalOutput TO AddHours + Addmin

     

    Hope this helps

    Usha

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Regex expressions for parse text is for minutes

    \d{2}.*(?=minutes)

    for hours

    .*(?=\shours)

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 233 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 178

Last 30 days Overall leaderboard