Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

TIme Separator in Google Sheets

I hope everyone reading this is doing well. I am making attendance sheets on Google Sheets that also calculates the salary of the person. It is entirely automated except for one part, the part that calculates salaries.

For that I need to separate the Hours and Minutes worked so that I can calculate the salary accurately based on 60 minutes instead of the first half being in hours and the second from a percentage of 100.

It coverts the hours into days and omits the remaining hours. Please assist. Thank you!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

What it does

What it should do

>Solution :

HOUR() returns the hour component of a specific time, so it will always return a value between 0 and 23.

In Google Sheets, times are just numbers where 1 indicates 1 day. So a duration of hh:mm:ss means hh/24 + mm/24/60 + ss/24/60/60 which means hours_in_a_day + minutes_in_a_day + seconds_in_a_day. (You can see this if you format the cell as "Number")

So, if you want to extract the hours from a duration, you have to multiply it by 24 and take the INT().

=INT(B20*24)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading