cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Larussa
Helper I
Helper I

Convert number and format hour(00:00) and sum two types of hours

hello

How it converts number into hours? After that I want sum with another number hour format.

Example: (2000/5500)*60=21,81  It"s 21 minutes and 81 second, I want to format 00:21. After that I want to sum whith(Example) 10:00+00:21=10:21. I need this result.

 

Thank you

16 REPLIES 16
RandyHayes
Super User
Super User

@Larussa 

I do not get those results in my sample of your scenario.

HOWEVER, I do see one typo in my formula.  On the first line I am referencing Label13...in looking back over your previous pictures, I believe I mistook that as 13, but it should be 3.

So, change formula to:

With({_productionMeasured : Value(Label3.Text), 
      _productionPPH : Value(Label15_1.Text),
      _minutesToAdd : With({_tval: TimeValue(Label12.Text)}, Hour(_tval)*60 + Minute(_tval))
     },
     
    With({_minutes:Round((_productionMeasured/_productionPPH)*60, 0) + _minutesToAdd  },
        With({
          _hours:RoundDown(_minutes/60, 0)
        },

        Text(_hours, "[$-en-US]00") & ":" & Text(Mod(_minutes, 60),"[$-en-US]00")
        )
    )
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

It worked very well 👏👏

Thank you very a lot

@RandyHayes 

 

Just one thing. It's word very well but maybe you help me became it better.

When the value passes 24:00(12:00 PM) it continues adding. Look at the example below

 

app19a.JPG

app19.JPG

Is there way to add, but instead 24:55 the result  is 00:55, when the result is greater than 24:00?

RandyHayes
Super User
Super User

@Larussa 

Wouldn't that be confusing?  How would you distinguish between 00:55 and 1:00:55 (1 day 55 minutes).

OR are you stating that your times are based around a 24 hour time? and 00:55 would be seen as 12:55 AM?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I'm sorry I'll try to explain

 

When the time exceed the Day and beginng another day, the time continues to sum

 

 I’d like it to stay like a clock

Exemplo:

01:00; 02:00... 23:00; 24:00; 01:00....

or

01:00; 02:00... 11:00;12:00; 01:00...

 

Look at picture below, Production time(30:17) but I'll be 06:17(other day)

app19b.JPG

 

 

RandyHayes
Super User
Super User

@Larussa 

No problem.  

Then change this line in the formula:

Text(_hours, "[$-en-US]00") & ":" & Text(Mod(_minutes, 60),"[$-en-US]00")

To this:

Text(Mod(_hours, 24), "[$-en-US]00") & ":" & Text(Mod(_minutes, 60),"[$-en-US]00")

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Larussa
Helper I
Helper I

@RandyHayes 

 

It's perfect. Congratulate

 

Thank you a lot

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (5,725)