Mastering Duration Format in Google Sheets

Montreal Jul 09, 2026

Duration formatting in Google Sheets is a powerful feature that allows you to display time in a user-friendly and easily understandable format. Understanding how to use this feature can significantly enhance the readability and organization of your data. Let's delve into the world of duration formatting in Google Sheets.

a screenshot of a spreadsheet with multiple columns and numbers on the screen
a screenshot of a spreadsheet with multiple columns and numbers on the screen

Google Sheets offers a wide range of duration formats to cater to different needs. These formats can be applied to cells containing numerical values representing time in days, hours, minutes, or seconds. By using these formats, you can convert these numerical values into a more readable format, such as '1 day 2 hours', '30 minutes', or '4 hours 30 minutes'.

The Ultimate Google Sheets Keyboard Shortcut Cheat Sheet for Beginners & Pros
The Ultimate Google Sheets Keyboard Shortcut Cheat Sheet for Beginners & Pros

Understanding Duration Format in Google Sheets

Before we dive into the specific duration formats, it's crucial to understand the structure of a duration in Google Sheets. A duration is essentially a combination of days, hours, minutes, and seconds. Each of these components is represented by a specific number of units. For instance, 1 day is equivalent to 24 hours, 1 hour is equivalent to 60 minutes, and 1 minute is equivalent to 60 seconds.

Tables in Google Sheets
Tables in Google Sheets

Google Sheets uses this structure to calculate and display durations. When you apply a duration format to a cell, the software converts the numerical value into the specified format based on this structure. For example, the value '25' would be displayed as '1 day' in the 'd' format, and as '1 day 1 hour' in the 'd hh' format.

Duration Format Codes

Basic Formatting in Google Sheets
Basic Formatting in Google Sheets

Google Sheets uses specific codes to represent different duration formats. These codes are appended to the cell format, separated by spaces. The most common duration format codes are:

  • 'd' for days
  • 'hh' for hours
  • 'mm' for minutes
  • 'ss' for seconds

For example, the format 'd hh:mm' would display the duration as '1 day 2 hours 30 minutes'.

Free Spreadsheet Templates for Excel & Google Sheets
Free Spreadsheet Templates for Excel & Google Sheets

Applying Duration Formats

To apply a duration format to a cell in Google Sheets, follow these steps:

  1. Select the cell(s) you want to format.
  2. Click on the 'Format' menu at the top of the screen.
  3. Hover over 'Number' and click on 'More formats...'.
  4. In the 'Category' dropdown, select 'Duration'.
  5. Choose the desired duration format from the list.
  6. Click 'Apply' to apply the format to the selected cells.
3 Steps to Master Your Emotions and Be Your Best Self
3 Steps to Master Your Emotions and Be Your Best Self

Using Duration Formats in Calculations

Duration formats aren't just for display purposes. They can also be used in calculations. Google Sheets can perform arithmetic operations on durations, allowing you to add, subtract, multiply, and divide them. For instance, you can calculate the total duration of a project by adding the durations of its individual tasks.

Create a Google Sheets Second Brain
Create a Google Sheets Second Brain
Yellow Project Estimate
Yellow Project Estimate
Essential Google Sheets Text and Web Formulas for Productivity
Essential Google Sheets Text and Web Formulas for Productivity
How to Use the SORTN Function in Google Sheets
How to Use the SORTN Function in Google Sheets
the google sheets are in green and white
the google sheets are in green and white
23 Best formulas for Google Sheets (+ Examples)
23 Best formulas for Google Sheets (+ Examples)
How to use Google Sheets: A beginner's guide | Zapier
How to use Google Sheets: A beginner's guide | Zapier
Veterinary Anesthesia Monitoring Chart, Automated Calculations (Google Sheet Template)
Veterinary Anesthesia Monitoring Chart, Automated Calculations (Google Sheet Template)
12 Free Aesthetic Google Sheets Budget Templates | Monthly Professional Finance Tracker
12 Free Aesthetic Google Sheets Budget Templates | Monthly Professional Finance Tracker
How to change the date format in Google Sheets!
How to change the date format in Google Sheets!
6 Crazy Google Sheets Formulas You Should Know
6 Crazy Google Sheets Formulas You Should Know
Google Sheets Tip: Conditional Formatting Custom Formulas – TCEA TechNotes Blog
Google Sheets Tip: Conditional Formatting Custom Formulas – TCEA TechNotes Blog
Quick tutorial: How to create dropdowns in Google Sheets (the easy way!)
Quick tutorial: How to create dropdowns in Google Sheets (the easy way!)
Google Sheets Checklists
Google Sheets Checklists
Google Sheets Attendance with drop down menu hack
Google Sheets Attendance with drop down menu hack
Google Sheets Formula Cheat Sheet
Google Sheets Formula Cheat Sheet
Google Sheets: Construct Formulas with the INDIRECT Function - Teacher Tech with Alice Keeler
Google Sheets: Construct Formulas with the INDIRECT Function - Teacher Tech with Alice Keeler
How to Sort By Date in Google Sheets
How to Sort By Date in Google Sheets

To perform calculations with durations, you need to ensure that the cells containing the durations are formatted as such. You can also use the 'Duration' data type in Google Apps Script to perform more complex calculations with durations.

Duration Formatting in Google Apps Script

Google Apps Script is a JavaScript-based scripting language built into the Google Apps platform. It allows you to automate tasks and create custom functions within Google Sheets. You can use the 'Duration' data type in Google Apps Script to perform calculations and manipulate durations.

Here's a simple example of how to use the 'Duration' data type in Google Apps Script:

```javascript var days = 2; var hours = 3; var minutes = 30; var seconds = 45; var duration = Duration.fromDays(days).plusHours(hours).plusMinutes(minutes).plusSeconds(seconds); Logger.log(duration); // Outputs: 2 days 3 hours 30 minutes 45 seconds ```

In this example, we create a 'Duration' object representing 2 days, 3 hours, 30 minutes, and 45 seconds. We then log this duration to the Logger service, which displays it in the 'd hh:mm:ss' format.

Duration formatting in Google Sheets is a versatile tool that can greatly enhance the usability of your data. Whether you're tracking project timelines, managing tasks, or analyzing performance metrics, understanding and utilizing duration formats can save you time and improve the accuracy of your data. So, go ahead and start exploring the world of duration formats in Google Sheets!