Timing formula in excel

Add time

Suppose that you want to know how many hours and minutes it will take to complete two tasks. You estimate that the first task will take 6 hours and 45 minutes and the second task will take 9 hours and 30 minutes.

Here is one way to set this up in the a worksheet.

  1. Enter 6:45 in cell B2, and enter 9:30 in cell B3.

  2. In cell B4, enter =B2+B3 and then press Enter.

    Time for two tasks added up

    The result is 16:15—16 hours and 15 minutes—for the completion the two tasks.

    Tip: You can also add up times by using the AutoSum function to sum numbers. Select cell B4, and then on the Home tab, choose AutoSum. The formula will look like this: =SUM(B2:B3). Press Enter to get the same result, 16 hours and 15 minutes.

Well, that was easy enough, but there’s an extra step if your hours add up to more than 24. You need to apply a special format to the formula result.

To add up more than 24 hours:

  1. In cell B2 type 12:45, and in cell B3 type 15:30.

  2. Type =B2+B3 in cell B4, and then press Enter.

    Time added up that's over 24 hours total an unexepcted result of 4:15

    The result is 4:15, which is not what you might expect. This is because the time for Task 2 is in 24-hour time. 15:30 is the same as 3:30.

  3. To display the time as more than 24 hours, select cell B4.

  4. On the Home tab, in the Cells group, choose Format, and then choose Format Cells.

    On the Home tab, Format button, and the Format cells button on the menu

  5. In the Format Cells box, choose Custom in the Category list.

  6. In the Type box, at the top of the list of formats, type [h]:mm;@ and then choose OK.

    Take note of the colon after [h] and a semicolon after mm.

The result is 28 hours and 15 minutes. The format will be in the Type list the next time you need it.

Subtract time

Here’s another example: Let’s say that you and your friends know both your start and end times at a volunteer project, and want to know how much time you spent in total.

Follow these steps to get the elapsed time—which is the difference between two times.

  1. In cell B2, enter the start time and include “a” for AM or “p” for PM. Then press Enter.

  2. In cell C2, enter the end time, including “a” or “p” as appropriate, and then press Enter.

  3. Type the other start and end times for your friends, Joy and Leslie.

  4. In cell D2, subtract the end time from the start time by entering the formula =C2-B2, and then press Enter.

    One time subtracted from another to get elapsed time

  5. In the Format Cells box, click Custom in the Category list.

  6. In the Type list, click h:mm (for hours and minutes), and then click OK.

    Now we see that Richard worked 3 hours and 45 minutes.

    Elpased times listed in column D

  7. To get the results for Joy and Leslie, copy the formula by selecting cell D2 and dragging to cell D4.

    The formatting in cell D2 is copied along with the formula.

To subtract time that’s more than 24 hours:

It is necessary to create a formula to subtract the difference between two times that total more than 24 hours.

Follow the steps below:

  1. Referring to the above example, select cell B1 and drag to cell B2 so that you can apply the format to both cells at the same time.

  2. In the Format Cells box, click Custom in the Category list.

  3. In the Type box, at the top of the list of formats, type m/d/yyyy h:mm AM/PM.

    Notice the empty space at the end of yyyy and at the end of mm.

    The new format will be available when you need it in the Type list.

  4. In cell B1, type the start date, including month/day/year and time using either “a” or “p” for AM and PM.

    Elapsed time over 24 hours

  5. In cell B2, do the same for the end date.

  6. In cell B3, type the formula =(B2-B1)*24.

The result is 31.5 hours.

Note: You can add and subtract more than 24 hours in Excel for the web but you cannot apply a custom number format.

Add time

Suppose you want to know how many hours and minutes it will take to complete two tasks. You estimate that the first task will take 6 hours and 45 minutes and the second task will take 9 hours and 30 minutes.

  1. In cell B2 type 6:45, and in cell B3 type 9:30.

  2. Type =B2+B3 in cell B4, and then press Enter.

Time for two tasks added up

It will take 16 hours and 15 minutes to complete the two tasks.

Tip: You can also add up times using AutoSum. Click in cell B4. Then click Home > AutoSum. The formula will look like this: =SUM(B2:B3). Press Enter to get the result, 16 hours and 15 minutes.

Subtract time

Say you and your friends know your start and end times at a volunteer project, and want to know how much time you spent. In other words, you want the elapsed time or the difference between two times.

  1. In cell B2 type the start time, enter a space, and then type “a” for AM or “p” for PM, and press Enter. In cell C2, type the end time, including “a” or “p” as appropriate, and press Enter. Type the other start and end times for your friends Joy and Leslie.

  2. In cell D2, subtract the end time from the start time by typing the formula: =C2-B2, and then pressing Enter. Now we see that Richard worked 3 hours and 45 minutes.

    One time subtracted from another to get elapsed time

  3. To get the results for Joy and Leslie, copy the formula by clicking in cell D2 and dragging to cell D4. The formatting in cell D2 is copied along with the formula.

    Elpased times listed in column D

Since dates and times are stored as numbers in the back end in Excel, you can easily use simple arithmetic operations and formulas on the date and time values.

For example, you can add two different time values or date values or you can calculate the time difference between two given dates/times.

In this tutorial, I will show you a couple of ways to perform calculations using time in Excel (such as calculating the time difference, adding or subtracting time, showing time in different formats, and doing a sum of time values)

How Excel Handles Date and Time?

As I mentioned, dates and times are stored as numbers in a cell in Excel. A whole number represents a complete day and the decimal part of a number would represent the part of the day (which can be converted into hours, minutes, and seconds values)

For example, the value 1 represents 01 Jan 1900 in Excel, which is the starting point from which Excel starts considering the dates.

So, 2 would mean 02 Jan 1990, 3 would mean 03 Jan 1900 and so on, and 44197 would mean 01 Jan 2021.

Note: Excel for Windows and Excel for Mac follow different starting dates. 1 in Excel for Windows would mean 1 Jan 1900 and 1 in Excel for Mac would mean 1 Jan 1904

If there are any digits after a decimal point in these numbers, Excel would consider those as part of the day and it can be converted into hours, minutes, and seconds.

For example, 44197.5 would mean 01 Jan 2021 12:00:00 PM.

Date and Time and its equivalent Numeric value

So if you’re working with time values in Excel, you would essentially be working with the decimal portion of a number.

And Excel gives you the flexibility to convert that decimal portion into different formats such as hours only, minutes only, seconds only, or a combination of hours, minutes, and seconds

Now that you understand how time is stored in Excel, let’s have a look at some examples of how to calculate the time difference between two different dates or times in Excel

Formulas to Calculating Time Difference Between Two Times

In many cases, all you want to do is find out the total time that has elapsed between the two-time values (such as in the case of a timesheet that has the In-time and the Out-time).

The method you choose would depend on how the time is mentioned in a cell and in what format you want the result.

Let’s have a look at a couple of examples

Simple Subtraction of Calculate Time Difference in Excel

Since time is stored as a number in Excel, find the difference between 2 time values, you can easily subtract the start time from the end time.

End Time – Start Time

The result of the subtraction would also be a decimal value that would represent the time that has elapsed between the two time-values.

Below is an example where I have the start and the end time and I have calculated the time difference with a simple subtraction.

Calculate time Difference with subtraction

There is a possibility that your results are shown in the time format (instead of decimals or in hours/minutes values). In our above example, the result in cell C2 shows 09:30 AM instead of 9.5.

That’s perfectly fine as Excel tries to copy the format from the adjacent column.

To convert this into a decimal, change the format of the cells to General (the option is in the Home tab in the Numbers group)

Once you have the result, you can format it in different ways. For example, you can show the value in hours only or minutes only or a combination of hours, minutes, and seconds.

Below are the different formats you can use:

Format What it Does
h Shows only the hours elapsed between the two dates
hh Shows hours in double-digit (such as 04 or 12)
hh:mm Shows hours and minutes elapsed between the two dates, such as 10:20
hh:mm:ss  Shows hours, minutes, and seconds elapsed between the two dates, such as 10:20:36

And if you’re wondering where and how to apply these custom date formats, follow the below steps:

  1. Select the cells where you want to apply the date format
  2. Hold the Control key and press the 1 key (or Command + 1 if using Mac)
  3. In the Format Cells dialog box that opens, click on the Number tab (if not selected already)Click the Number group
  4. In the left pane, click on CustomClick on Custom option in Format Cells dialog box
  5. Enter any of the desired format code in the Type field (in this example, I am using hh:mm:ss)Enter the code to show hour minutes and seconds
  6. Click OK

The above steps would change the formatting and show you the value based on the format.

Result of time difference calculation

Note that custom number formatting does not change the value in the cell. It only changes the way a value is being displayed. So, I can choose to only show the hour value in a cell, while it would still have the original value.

Pro tip: If the total number of hours exceeds 24 hours, use the following custom number format instead: [hh]:mm:ss

Calculate the Time Difference in Hours, Minutes, or Seconds

When you subtract the time values, Excel returns a decimal number that represents the resulting time difference.

Since every whole number represents one day, the decimal part of the number would represent that much part of the day which can easily be converted into hours or minutes, or seconds.

Calculating Time Difference in Hours

Suppose you have the dataset as shown below and you want to calculate the number of hours between the two-time values

Time difference where we need to calculate hours

Below is the formula that will give you the time difference in hours:

=(B2-A2)*24
Time difference in houts

The above formula will give you the total number of hours elapsed between the two-time values.

Sometimes, Excel tries to be helpful and will give you the result in time format as well (as shown below).

Time difference shown in the time format only

You can easily convert this into Number format by clicking on the Home tab, and in the Number group, selecting Number as the format.

Click the Number option in the format drop down

If you only want to return the total number of hours elapsed between the two times (without any decimal part), use the below formula:

=INT((B2-A2)*24)
Calculating hours elapsed between two times

Note: This formula only works when both the time values are of the same day. If the day changes (where one of the time values is of another date and the second one of another date), This formula will give wrong results. Have a look at the section where I cover the formula to calculate the time difference when the date changes later in this tutorial.

Calculating Time Difference in Minutes

To calculate the time difference in minutes, you need to multiply the resulting value by the total number of minutes in a day (which is 1440 or 24*60).

Suppose you have a data set as shown below and you want to calculate the total number of minutes elapsed between the start and the end date.

Time difference where we need to calculate hours

Below is the formula that will do that:

=(B2-A2)*24*60
Calculate Time difference in Minutes

Calculating Time Difference in Seconds

To calculate the time difference in seconds, you need to multiply the resulting value by the total number of seconds in a day (which is or 24*60*60 or 86400).

Suppose you have a data set as shown below and you want to calculate the total number of seconds that have elapsed between the start and end date.

Time difference where we need to calculate hours

Below is the formula that will do that:

=(B2-A2)*24*60*60
Calculate Time difference in seconds

Calculating time difference with the TEXT function

Another easy way to quickly get the time difference without worrying about changing the format is to use the TEXT function.

The TEXT function allows you to specify the format right within the formula.

=TEXT(End Date - Start Date, Format)

The first argument is the calculation you want to do, and the second argument is the format in which you want to show the result of the calculation.

Suppose you have a dataset as shown below and you want to calculate the time difference between the two times.

Time difference where we need to calculate hours

Here are some formulas that will give you the result with different formats

Show only the number of hours:

=TEXT(B2-A2,"hh")
Calculating Time in hours using TEXT Function

The above formula will only give you the result that shows the numbers of hours elapsed between the two-time values. If your result is 9 hours and 30 minutes, it will still show you 9 only.

Show the number of total minutes

=TEXT(B2-A2,"[mm]")
Calculating Time in Minutes using TEXT Function

Show the number of total seconds

=TEXT(B2-A2,"[ss]")
Calculating Time in Seconds using TEXT Function

Show Hours and Minutes

=TEXT(B2-A2,"[hh]:mm")
Time difference in hours and minutes

Show Hours, Minutes, and Seconds

=TEXT(B2-A2,"hh:mm:ss")
Time difference in hours minutes and Seconds

If you’re wondering what’s the difference between hh and [hh] in the format (or mm and [mm]), when you use the square brackets, it would give you the total number of hours between the two dates, even if the hour value is higher than 24. So if you subtract two date values where the difference is more than24 hours, using [hh] will give you the total number of hours and hh will only give you the hours elapsed on the day of the end date.

Get the Time Difference in One-Unit (Hours/Minutes) and Ignore Others

If you want to calculate the time difference between the two time-values in only the number of hours or minutes or seconds, then you can use the dedicated HOUR, MINUTE, or SECOND function.

Each of these functions takes one single argument, which is the time value, and returns the specified time unit.

Suppose you have a data set as shown below, and you want to calculate the total number of hours minutes, and seconds that have elapsed between these two times.

In and Out time dataset

Below are the formulas to do this:

Calculating Hours Elapsed Between two times

=HOUR(B2-A2)
HOUR formula

Calculating Minutes from the time value result (excluding the completed hours)

=MINUTE(B2-A2)
Minute formula

Calculating Seconds from the time value result (excluding the completed hours and minutes)

=SECOND(B2-A2)
Second formula

A couple of things that you need to know when working with these HOURS, MINUTE, and SECOND formulas:

  • The difference between the end time and the start time cannot be negative (which is often the case when the date changes). In such cases, these formulas would return a #NUM! error
  • These formulas only use the time portion of the resulting time value (and ignore the day portion). So if the difference in the end time and the start time is 2 Days, 10 Hours, 32 Minutes, and 44 Seconds, the HOUR formula will give 10, the MINUTE formula will give 32, and the SECOND formula will give 44

Calculate elapsed time Till Now (from the start time)

If you want to calculate the total time that has elapsed between the start time and the current time, you can use the NOW formula instead of the End time.

NOW function returns the current date and the time in the cell in which it is used. It’s one of those functions that does not take any input argument.

So, if you want to calculate the total time that has elapsed between the start time and the current time, you can use the below formula:

=NOW() - Start Time

Below is an example where I have the start times in column A, and the time elapsed till now in column B.

Calculating time elapsed till now

If the difference in time between the start date and time and the current time is more than 24 hours, then you can format the result to show the day as well as the time portion.

You can do that by using the below TEXT formula:

=TEXT(NOW()-A2,"dd hh:ss:mm")

You can also achieve the same thing by changing the custom formatting of the cell (as covered earlier in this tutorial) so that it shows the day as well as the time portion.

In case your start time only has the time portion, then Excel would consider it as the time on 1st January 1990.

In this case, if you use the NOW function to calculate the time elapsed till now, it is going to give you the wrong result (as the resulting value would also have the total days that have elapsed since 1st Jan 1990).

In such a case, you can use the below formula:

=NOW()- INT(NOW())-A2

The above formula uses the INT function to remove the day portion from the value returned by the now function, and this is then used to calculate the time difference.

Note that NOW is a volatile function that updates whenever there is a change in the worksheet, but it does not update in real-time

Calculate Time When Date Changes (calculate and display negative times in Excel)

The methods covered so far work well if your end time is later than the start time.

But the problem arises when your end time is lower than the start time. This often happens when you are filling timesheets where you only enter the time and not the entire date and time.

In such cases, if you’re working in a one night shift and the date changes, there is a possibility that your end time would be earlier than your start time.

For example, if you start your work at 6:00 PM in the evening, and complete your work & time out at 9:00 AM in the morning.

If you only working with time values, then subtracting the start time from the end time is going to give you a negative value of 9 hours (9 – 18).

And Excel cannot handle negative time values (and for that matter nor can humans, unless you can time travel)

In such cases, you need a way to figure out that the day has changed and the calculation should be done accordingly.

Thankfully, there is a really easy fix for this.

Suppose you have a dataset as shown below, where I have the start time and the end time.

In and out time on different dates

As you would notice that sometimes the start time is in the evening and the end time is in the morning (which indicates that this was an overnight shift and the day has changed).

If I use the below formula to calculate the time difference, it will show me the hash signs in the cells where the result is a negative value (highlighted in yellow in the below image).

=B2-A2
Showing hash instead of time elapsed

Here is an IF formula that whether the time difference value is negative or not, and in case it is negative then it returns the right result

=IF((B2-A2)<0,1-(A2-B2),(B2-A2))
Formula to calculate time when date changes

While this works well in most cases, it still falls short in case the start time and the end time is more than 24 hours apart. For example, someone signs in at 9:00 AM on day 1 and sign-out at 11:00 AM on day 2.

Since this is more than 24 hours, there is no way to know whether the person has signed out after 2 hours or after 26 hours.

While the best way to tackle this would be to make sure that the entries include the date as well as the time, but if it’s just the time that you’re working with, then the above formula should take care of most of the issues (considering it’s unlikely for anyone to work for more than 24 hours)

Adding/ Subtracting Time in Excel

So far, we have seen examples where we had the start and the end time, and we needed to find the time difference.

Excel also allows you to easily add or subtract a fixed time value from the existing date and time value.

For example, let’s say you have a list of queued tasks where each task takes the specified time, and you want to know when each task will end.

In such a case, you can easily add the time that each task is going to take to the start time to know at what time is the task expected to be completed.

Since Excel stores date and time values as numbers, you have to ensure that the time you are trying to add abides by the format that Excel already follows.

For example, if you add 1 to a date in Excel, it is going to give you the next date. This is because 1 represents an entire day in Excel (which is equal to 24 hours).

So if you want to add 1 hour to an existing time value, you cannot go ahead and simply add 1 to it. you have to make sure that you convert that hour value into the decimal portion that represents one hour. and the same goes for adding minutes and seconds.

Using the TIME Function

Time function in Excel takes the hour value, the minute value, and the seconds value and converts it into a decimal number that represents this time.

For example, if I want to add 4 hours to an existing time, I can use the below formula:

=Start Time + TIME(4,0,0)
Adding time using the TIME function

This is useful if you know how many hours, minutes, and seconds you want to add to an existing time and simply use the TIME function without worrying about the correct conversion of the time into a decimal value.

Also, note that the TIME function will only consider the integer part of the hour, minute, and seconds value that you input. For example, if I use 5.5 hours in the TIME function it would only add five hours and ignore the decimal part.

Also, note that the TIME function can only add values that are less than 24 hours. If your hour value is more than 24, this would give you an incorrect result.

And the same goes with the minutes and the second’s part where the function will only consider values that are less than 60 minutes and 60 seconds

Just like I have added time using the TIME function, you can also subtract time. Just change the + sign to a negative sign in the above formulas

Using Basic Arithmetic

When the time function is easy and convenient to use, it does come with a few restrictions (as covered above).

If you want more control, you can use the arithmetic method that I’ll cover here.

The concept is simple – convert the time value into a decimal value that represents the portion of the day, and then you can add it to any time value in Excel.

For example, if you want to add 24 hours to an existing time value, you can use the below formula:

=Start_time + 24/24

This just means that I’m adding one day to the existing time value.

Now taking the same concept forward let’s say you want to add 30 hours to a time value, you can use the below formula:

=Start_time + 30/24

The above formula does the same thing, where the integer part of the (30/24) would represent the total number of days in the time that you want to add, and the decimal part would represent the hours/minutes/seconds

Similarly, if you have a specific number of minutes that you want to add to a time value then you can use the below formula:

=Start_time + (Minutes to Add)/24*60

And if you have the number of seconds that you want to add, then you can use the below formula:

=Start_time + (Minutes to Add)/24*60*60

While this method is not as easy as using the time function, I find it a lot better because it works in all situations and follows the same concept. unlike the time function, you don’t have to worry about whether the time that you want to add is less than 24 hours or more than 24 hours

You can follow the same concept while subtracting time as well. Just change the + to a negative sign in the formulas above

How to SUM time in Excel

Sometimes you may want to quickly add up all the time values in Excel. Adding multiple time values in Excel is quite straightforward (all it takes is a simple SUM formula)

But there are a few things you need to know when you add time in Excel, specifically the cell format that is going to show you the result.

Let’s have a look at an example.

Below I have a list of tasks along with the time each task will take in column B, and I want to quickly add these times and know the total time it is going to take for all these tasks.

Activity and time taken data

In cell B9, I have used a simple SUM formula to calculate the total time all these tasks are going to take, and it gives me the value as 18:30 (which means that it is going to take 18 hours and 20 minutes to complete all these tasks)

Sum of time where sum is less than 24 hours

All good so far!

How to SUM over 24 hours in Excel

Now see what happens when I change at the time it is going to take Task 2 to complete from 1 hour to 10 hours.

SUM formula giving incorrect time value

The result now says 03:20, which means that it should take 3 hours and 20 minutes to complete all these tasks.

This is incorrect (obviously)

The problem here is not Excel messing up. The problem here is that the cell is formatted in such a way that it will only show you the time portion of the resulting value.

And since the resulting value here is more than 24 hours, Excel decided to convert the 24 hours part into a day remove it from the value that is shown to the user, and only display the remaining hours, minutes, and seconds.

This, thankfully, has an easy fix.

All you need to do is change the cell format to force it to show hours even if it exceeds 24 hours.

Below are some formats that you can use:

Format Expected Result
[h]:mm 28:30
[m]:ss 1710:00
d “D” hh:mm 1 D 04:30
d “D” hh “Min” ss “Sec” 1 D 04 Min 00 Sec
d “Day” hh “Minute” ss “Seconds” 1 Day 04 Minute 00 Seconds

You can change the format by going to the format cells dialog box and applying the custom format, or use the TEXT function and use any of the above formats in the formula itself

You can use the below the TEXT formula to show the time, even when it’s more than 24 hours:

=TEXT(SUM(B2:B7),"[h]:mm:ss")
TEXT formula to show hours when more than 24

or the below formula if you want to convert the hours exceeding 24 hours to days:

=TEXT(SUM(B2:B7),"dd hh:mm:ss")
TEXT formula to show days in the time result

Results Showing Hash (###) Instead of Date/Time (Reasons + Fix)

In some cases, you may find that instead of showing you the time value, Excel is displaying the hash symbols in the cell.

Here are some possible reasons and the ways to fix these:

The column is not wide enough

When a cell doesn’t have enough space to show the complete date, it may show the hash symbols.

It has an easy fix – change the column width and make it wider.

Negative Date Value

A date or time value cannot be negative in Excel. in case you are calculating the time difference and it turns out to be negative, Excel will show you hash symbols.

The way to fixes to change the formula to give you the right result. For example, if you are calculating the time difference between the two times, and the date changes, you need to adjust the formula to account for it.

In other cases, you may use the ABS function to convert the negative time value into a positive number so that it’s displayed correctly. Alternatively, you can also an IF formula to check if the result is a negative value and return something more meaningful.

In this tutorial, I covered topics about calculating time in Excel (where you can calculate the time difference, add or subtract time, show time in different formats, and sum time values)

I hope you found this tutorial useful.

Other Excel tutorials you may also like:

  • Convert Time to Decimal Number in Excel (Hours, Minutes, Seconds)
  • How to Remove Time from Date/Timestamp in Excel
  • How to Calculate the Number of Days Between Two Dates in Excel
  • Combine Date and Time in Excel
  • How to Calculate Years of Service in Excel
  • How to Convert Seconds to Minutes in Excel

Purpose 

Create a time with hours, minutes, and seconds

Return value 

A decimal number representing a particular time in Excel.

Usage notes 

The TIME function creates a valid Excel time based with supplied values for hour, minute, and second. Like all Excel time, the result is a number that represents a fractional day. The TIME function will only return time values up to one full day, between 0 (zero) to 0.99999999, or 0:00:00 to 23:59:59.  To see results formatted as time, apply a time-based number format. 

Examples

=TIME(3,0,0) // 3 hours
=TIME(0,3,0) // 3 minutes
=TIME(0,0,3) // 3 seconds
=TIME(8,30,0) // 8.5 hours

The TIME function can interpret units in larger increments. For example, both of the formulas below return a result of 2 hours:

=TIME(0,120,0) // 2 hours
=TIME(0,0,7200) // 2 hours

However, when total time reaches 24 hours, the TIME function will «reset» to zero.

=TIME(12,0,0) // 12 hours
=TIME(36) // 12 hours

In this way, TIME behaves like a 24 hour clock that resets when it crosses midnight. Notably, TIME will not handle numeric inputs larger 32,767. For example, even though there are 86,400 seconds in a day, the following formula (which represents 12 hours) will fail with a #NUM! error:

=TIME(0,0,43200) // returns #NUM! 

As a workaround, you can convert hours, minutes, and seconds directly to Excel time with a formula:

=hours/24+minutes/1440+seconds/86400

The result is the same as the TIME function up to 24 hours. Over 24 hours, this formula will continue to accumulate time, unlike the TIME function.

Notes

  • When total time reaches 24 hours, the TIME function will «reset» to zero. 
  • The largest number that TIME will allow for hour, minute, or second is 32,767. Larger values will return a #NUM! error.

TIME Formula in Excel

TIME is a time worksheet function in Excel that is used to make time from the arguments provided by the user. The arguments are in the following format: hours, minutes, and seconds. The range for the input for hours can be from 0-23, and for minutes it is 0-59 and similar for seconds. The method to use this function is as follows: =Time( Hours, Minutes, Seconds).

For example, TIME(0,0,3500) = 0.04050925 or 12:58:20 AM.

Table of contents
  • TIME Formula in Excel
    • Explanation
    • Usage Notes
    • How to Open the TIME Function in Excel?
    • How to Use TIME in Excel Sheet?
      • Example #1
      • Example #2
      • Example #3
      • Example #4
      • Example #5
      • Example #6
      • Example #7
      • Example #8
    • Excel TIME Function Errors
    • Things to Remember
    • TIME Function in Excel Video
    • Recommended Articles

TIME FORMULA

Explanation

The formula of TIME accepts the following parameters and arguments:

  • hour – This can be any number between 0 and 32767, representing the hour. The point to be noted for this argument is that if the hour value is larger than 23, it will then be divided by 24. The remainder of the division will be used as the hour value. For better understanding, TIME(24,0,0) will be equal to TIME(0,0,0), TIME (25,0,0) means TIME(1,0,0) and TIME(26,0,0) will be equal to TIME(2,0,0) and so on.
  • minute – This can be any number between 0 and 32767, representing the minute. For this argument, you should note that if the minute value is larger than 59, every 60 minutes will add up to 1 hour in the pre-existing hour value. For better understanding, TIME(0,60,0) will be equal to TIME(1,0,0) and TIME(0,120,0) will be equal to TIME(2,0,0) and so on.
  • second – This can be any number between 0 and 32767, representing the second. For this argument, you should note that if the second value exceeds 59, then every 60 seconds will be added 1 minute to the pre-existing minute value. For better understanding, TIME(0,0,60) will be equal to TIME(0,1,0) and TIME(0,0,120) will be equal to TIME(0,2,0) and so on.

Return Value of TIME Formula:

The return value will be a numeric value between 0 and 0.999988426, which represents a particular timesheet.

Usage Notes

  • The TIME in the Excel sheet is used for creating a date in serial number format from the hour, minute, and seconds components, which you specify.
  • The TIME sheet creates a correct time if you have the values of the above components separately. For example, TIME(3,0,0,) is equal to 3 hours, TIME(0,3,0) is equal to 3 minutes, TIME (0,0,3) is equal to 3 seconds, and TIME(8,30,0) is equal to 8.5 hours.
  • Once you get the right time, you can easily format it as per your requirements.

How to Open the TIME Function in Excel?

  1. You can enter the desired TIME formula in the required cell to attain a return value on the argument.
  2. You can manually open the TIME formula dialogue box in the spreadsheet and enter the logical values to attain a return value.
  3. Consider the screenshot below to see the formula of the TIME option under the DATE and TIME function in the Excel menu.

    TIME Function Step 2

How to Use TIME in Excel Sheet?

Take a look at the below-given examples of TIME in the ExcelTo add time in Excel, the user can directly enter the time values in the hh:mm format into the cell. Remember that the time entered in the cell should not exceed 24 hours. For instance, 5.30 in the evening is written as 17:30.read more sheet. These TIME function examples will help you explore the use of the TIME function in Excel and clarify the concept of the TIME function.

You can download this TIME Function Excel Template here – TIME Function Excel Template

TIME Function Example 1

The above screenshot shows that three columns have been included: D, E, and F. These columns have different formats that offer the results generated from the TIME function. Consider the following points for better understanding.

  • The column D cells are formatted with the “General” format to display the result from the TIME function in decimal values.
  • The column E cells are formatted with the default h:mm AM/PM format. It is how Excel automatically formats the results once you enter the TIME formula.
  • The column F cells are formatted with h:mm:ss AM/PM custom format. It will help you see the full hours, minutes, and seconds.

Based on the above Excel spreadsheet, let us consider eight examples and see the TIME function return based on the syntax.

Note- To attain the result, you must enter the TIME formula in all three columns, D, E, and F cells.

TIME FUnction Example 1

Consider the screenshots of the above examples for a clear understanding.

Example #1

TIME Function Example1

Example #2

TIME Function Example2

Example #3

TIME Function Example3

Example #4

Example 4

Example #5

Example 5

Example #6

Example 6

Example #7

Example 7

Example #8

Example8

Excel TIME Function Errors

If you get any error from the TIME function, it can be one of the following.

#NUM! – This kind of error occurs if the argument provided by you is evaluating a negative time; for example, if the supplied hour is less than 0.

#VALUE! – This kind of error occurs if any of the arguments are supplied by you in non-numeric.

Things to Remember

  • The TIME function in Excel allows you to create time with individual hour, minute, and second components.
  • The TIME in Excel is categorized under the DATE and TIME functions.
  • The TIME function will return a decimal value between 0 and 0.999988426, giving an hour, minute, and second value.
  • After using the TIME on Excel, once you get the right time, we can easily format it as per the requirements.

TIME Function in Excel Video

Recommended Articles

This article has been a guide to TIME Function in Excel. Here, we discuss the TIME formula in Excel and how to use the TIME function, along with Excel examples and downloadable Excel templates. You may also look at these useful functions in Excel: –

  • Subtract Time in Excel FormulaFor subtraction of time values less than 24 hours, we can easily subtract using the ‘-’ operator. However, the time values that on subtraction exceed 24 hours/60 minutes/60 seconds are ignored by Excel. Therefore, we use a custom number format in such cases.read more
  • Timeline ChartIn project management terms, an Excel timeline chart is also known as a Milestone chart. It is used to visually track all stages of a project and assists a project manager in delivering the project to the end-user as committed before the start of the project.read more
  • DAY FunctionIn Excel, the DAY function calculates the day value from a given date. This function accepts a date as an argument and returns a two-digit numeric value as an integer value representing the given date’s day. The formula to use this function is =Edate(serial number).read more
  • TODAY Excel FunctionToday function is a date and time function that is used to find out the current system date and time in excel. This function does not take any arguments and auto-updates anytime the worksheet is reopened. This function just reflects the current system date, not the time.read more
  • Search For Text in ExcelExcel provides the functionality that helps you to search for text in the file. You can use Find and Search function to search for a specific text cell value and arrive at the result.read more

Reader Interactions

Skip to content

Как посчитать время – разницу, сумму, добавить или вычесть

В статье рассматривается, как в Excel посчитать время. Вы найдете несколько полезных формул чтобы посчитать сумму времени, разницу во времени или сколько времени прошло и многое другое.

Ранее мы внимательно рассмотрели особенности формата времени Excel и возможности основных функций времени. Сегодня мы углубимся в вычисления времени в Excel, и вы узнаете еще несколько формул для эффективного управления временем в ваших таблицах.

Как посчитать разницу во времени в Excel (прошедшее время)

Для начала давайте посмотрим, как можно быстро посчитать в Excel сколько прошло времени, т.е. найти разницу между временем начала и временем окончания. И, как это часто бывает, существует несколько способов для расчета времени. Какую из них выбрать, зависит от вашего набора данных и того, какого именно результата вы пытаетесь достичь. Итак, давайте посмотрим несколько вариантов.

Вычесть одно время из другого

Как вы, наверное, знаете, время в Excel — это обычные десятичные числа, отформатированные так, чтобы они выглядели как время. И поскольку это числа, вы можете складывать и вычитать время так же, как и любые другие числовые значения.

Самая простая и очевидная формула Excel чтобы посчитать время от одного момента до другого:

Время окончания — Время начала

В зависимости от ваших данных, формула разницы во времени может принимать различные формы, например:

Формула Пояснение
=A2-B2 Вычисляет разницу между временами в ячейках A2 и B2.
=ВРЕМЗНАЧ(«21:30») — ВРЕМЗНАЧ («8:40») Вычисляет разницу между указанными моментами времени, которые записаны как текст.
=ВРЕМЯ(ЧАС(A2); МИНУТЫ(A2); СЕКУНДЫ(A2)) — ВРЕМЯ (ЧАС (B2); МИНУТЫ (B2); СЕКУНДЫ (B2)) Вычисляет разницу во времени между значениями в ячейках A2 и B2, игнорируя разницу в датах, когда ячейки содержат значения даты и времени.

Помня, что во внутренней системе Excel время представлено дробной частью десятичного числа, вы, скорее всего, получите результаты, подобные этому скриншоту:

В зависимости оп применяемого форматирования, в столбце D вы можете увидеть десятичные дроби (если установлен формат Общий). Чтобы сделать результаты более информативными, вы можете настроить отображаемый формат времени с помощью одного из следующих шаблонов:

Формат Объяснение
ч Прошедшее время отображается только в часах, например: 4.
ч:мм Прошедшие часы и минуты отображаются в формате 4:50.
ч:мм:сс Прошедшие часы, минуты и секунды отображаются в формате 4:50:15.

Чтобы применить пользовательский формат времени, используйте комбинацию клавиш Ctrl + 1, чтобы открыть диалоговое окно «Формат ячеек», выберите «Пользовательский»  и введите шаблон формата в поле «Тип». Подробные инструкции вы можете найти в статье Создание пользовательского формата времени в Excel .

А теперь давайте разберем это на простых примерах. Если время начала находится в столбце B, а время окончания — в столбце A, вы можете использовать эту простую формулу:

=$A2-$B2

Прошедшее время отображается по-разному в зависимости от использованного формата времени, как видно на этом скриншоте:

Примечание. Если время отображается в виде решеток (#####), то либо ячейка с формулой недостаточно широка, чтобы вместить полученный результат, либо итогом ваших расчетов времени является отрицательное число. Отрицательное время в Экселе недопустимо, но это ограничение можно обойти, о чем мы поговорим далее.

Вычисление разницы во времени с помощью функции ТЕКСТ

Еще один простой метод расчета продолжительности между двумя временами в Excel — применение функции ТЕКСТ:

  • Рассчитать часы между двумя временами:   =ТЕКСТ(A2-B2; «ч»)
  • Рассчитать часы и минуты:                             =ТЕКСТ(A2-B2;»ч:мм»)
  • Посчитать часыминуты и секунды:              =ТЕКСТ(A2-B2;»ч:мм:сс»)

Как видно на скриншоте ниже, вы сразу получаете время в нужном вам формате. Специально устанавливать пользовательский формат ячейки не нужно.

Примечание:

  • Значение, возвращаемое функцией ТЕКСТ, всегда является текстом. Обратите внимание на выравнивание по левому краю содержимого столбцов C:E на скриншоте выше. В некоторых случаях это может быть существенным ограничением, поскольку вы не сможете использовать полученное «текстовое время» в других вычислениях.
  • Если результатом является отрицательное число, ТЕКСТ возвращает ошибку #ЗНАЧ!.

Как сосчитать часы, минуты или секунды

Чтобы получить разницу во времени только в какой-то одной единице времени (только в часах, минутах или секундах), вы можете выполнить следующие вычисления.

Как рассчитать количество часов.

Чтобы представить разницу в часах между двумя моментами времени в виде десятичного числа, используйте следующую формулу:

=( Время окончания — Время начала ) * 24

Если начальное время записано в A2, а время окончания – в B2, вы можете использовать простое выражение B2-A2, чтобы вычислить разницу между ними, а затем умножить результат на 24. Это даст количество часов:

=(B2-A2)* 24

Чтобы получить количество полных часов, используйте функцию ЦЕЛОЕ, чтобы округлить результат до ближайшего целого числа:

=ЦЕЛОЕ((B2-A2) * 24)

Пример расчета разницы во времени только в одной единице измерения вы видите на скриншоте ниже.

Считаем сколько минут в интервале времени.

Чтобы вычислить количество минут между двумя метками времени, умножьте разницу между ними на 1440, что соответствует количеству минут в одном дне (24 часа * 60 минут = 1440).

=( Время окончания — Время начала ) * 1440

Как показано на скриншоте выше, формула может возвращать как положительные, так и отрицательные значения. Отрицательные возникают, когда время окончания меньше времени начала, как в строке 5:

=(B2-A2)*1440

Как сосчитать количество секунд.

Чтобы посчитать разницу в секундах между двумя моментами времени, вы умножаете разницу во времени на 86400, что соответствует числу секунд в одном дне (24 часа * 60 минут * 60 секунд = 86400).

=( Время окончания — Время начала ) * 86400

В нашем примере расчет выглядит следующим образом:

=(B2-A2)* 86400

Примечание. Чтобы результаты отображались правильно, к ячейкам с вашей формулой разницы во времени следует применить общий либо числовой формат.

Как посчитать разницу в каждой единице времени.

Чтобы найти разность между двумя точками времени и выразить ее только в одной определенной единице времени, игнорируя остальные, используйте одну из следующих функций.

  • Разница в часах без учета минут и секунд:

=ЧАС(B2-A2)

  • Разница в минутах без учета часов и секунд:

=МИНУТЫ(B2-A2)

  • Разница в секундах без учета часов и минут:

=СЕКУНДЫ(B2-A2)

При использовании функций Excel ЧАС, МИНУТЫ и СЕКУНДЫ помните, что результат не может превышать 24 для часов, и 60 – для минут и секунд.

В данном случае не играет роли, сколько дней прошло с даты начала до даты окончания. Учитывается только дробная часть числа, то есть время.

Примечание. Однако,если в ячейку вы записали не просто время, а дату и время, и при этом дата окончания окажется меньше даты начала (т. е. результатом будет отрицательное число), то вы увидите ошибку #ЧИСЛО!.

Как перевести секунды в часы, минуты и секунды

Часто случается, что длительность какого-то события представлена в каких-то одних единицах времени. К примеру, различные приборы зачастую возвращают измеренное ими время в секундах. И это число нам нужно перевести в привычный формат времени – в часы, минуты и секунды, а при необходимости – еще и в дни.

Давайте рассмотрим небольшой пример.

Предположим, зафиксирована продолжительность события 284752 секунд. Переведем число секунд в дни, часы, минуты и секунды.

Вот как это будет:

Дни:

=ЦЕЛОЕ(A2/(60*60*24))

Часы:

=ЦЕЛОЕ(A2/(60*60)) — ЦЕЛОЕ(A2/(60*60*24))*24

Минуты:

=ЦЕЛОЕ(A2/60) — ЦЕЛОЕ(A2/(60*60))*60

Секунды – это просто две последние цифры:

=—ПРАВСИМВ(A2;2)

Если нужно рассчитать время только в часах, минутах и секундах, то изменим формулу подсчета часов:

=ЦЕЛОЕ(A2/(60*60))

Конечно, здесь результат может быть больше 24.

Минуты и секунды подсчитываем, как и прежде.

Еще один вариант перевода секунд в дни, часы, минуты и секунды вы можете посмотреть на скриншоте ниже.

Расчет времени с момента начала до настоящего момента

Чтобы рассчитать, сколько времени прошло с какой-то даты до настоящего момента, вы просто используете функцию ТДАТА, чтобы вернуть сегодняшнюю дату и текущее время, а затем вычесть из них  дату и время начала.

Предположим, что начальная дата и время находятся в A2, выражение =ТДАТА()-A2 возвращает следующие результаты, при условии, что вы применили соответствующий формат времени к столбцу B (в этом примере «ч:мм») :

Если прошло больше чем 24 часа, используйте один из этих форматов времени , например Д «дн.» ч:мм:сс, как показано на скриншоте ниже:

Если ваши начальные данные содержат только время без дат, вам нужно использовать функцию ВРЕМЯ, чтобы правильно рассчитать, сколько времени прошло. Например, следующая формула возвращает время, истекшее с момента, указанного в ячейке A2, и до текущего момента:

=ВРЕМЯ(ЧАС(ТДАТА()); МИНУТЫ(ТДАТА()); СЕКУНДЫ(ТДАТА())) — A2

Примечание. Прошедшее время не обновляется в режиме реального времени, оно заново рассчитывается только при повторном открытии или пересчете рабочей книги. Чтобы принудительно обновить результат, нажмите либо Shift + F9, чтобы пересчитать активную таблицу, или F9 для пересчета всех открытых книг. Еще один способ быстрого пересчета – внесите изменения в любую ячейку вашего рабочего листа.

Отображение разницы во времени как «XX дней, XX часов, XX минут и XX секунд».

Это, вероятно, самая удобная формула для расчета разницы во времени в Excel. Вы используете функции ЧАС, МИНУТЫ и СЕКУНДЫ для возврата соответствующих единиц времени, и функцию ЦЕЛОЕ для вычисления разницы в днях. Затем вы объединяете все эти функции в одно выражение вместе с текстовыми пояснениями:

=ЦЕЛОЕ(B2-A2)&» дн., «&ЧАС(B2-A2)&» час., «&МИНУТЫ(B2-A2)&» мин. и «&СЕКУНДЫ(B2-A2)&» сек.»

Вот как это может выглядеть:

Чтобы скрыть нулевые результаты в формуле разницы во времени в Excel, встройте в нее четыре функции ЕСЛИ:

=ЕСЛИ(ЦЕЛОЕ(B2-A2)>0; ЦЕЛОЕ(B2-A2) & » дн.,  «;»») &

ЕСЛИ(ЧАС(B2-A2)>0; ЧАС(B2-A2) & » час.,  «;»») &

ЕСЛИ(МИНУТЫ(B2-A2)>0; МИНУТЫ(B2-A2) & » мин. и  «;»») &

ЕСЛИ(СЕКУНДЫ(B2-A2)>0; СЕКУНДЫ(B2-A2) & » сек.»;»»)

Синтаксис может показаться чрезмерно сложным, но это работает :)

Кроме того, вы можете рассчитать разницу во времени, просто вычитая время начала из времени окончания (например =B2-A2 ), а затем применив к ячейке следующий формат времени:

Д «дн.,» ч «час.,» м «мин. и » с «сек.»

Преимущество этого подхода заключается в том, что вашим результатом будет обычное значение времени, которое вы можете задействовать в других расчетах, в то время как результатом сложной формулы, описанной выше, является текст. 

Недостатком же здесь является то, что пользовательский формат времени не может различать нулевые и ненулевые значения и игнорировать нули.

Как рассчитать и отобразить отрицательное время в Excel

При расчете разницы во времени в Excel вы иногда можете получить результат в виде ошибки ######, если вдруг она представляет собой отрицательное число. Это происходит, если время начала больше, чем время окончания события. Такое часто случается, если рассчитывают продолжительность каких-то событий без учета даты. Получается, что время окончания меньше, чем время начала, поскольку это просто время следующего дня. К примеру, мы начинаем работу в 17 часов и заканчиваем на следующий день в 10 часов.

Но есть ли способ правильно отображать отрицательное время в Excel? Конечно, способ есть, и даже не один.

Способ 1. Измените систему дат Excel на систему дат 1904 года.

Самый быстрый и простой способ нормально отображать отрицательное время (со знаком минус) — это перейти на систему дат 1904 года. Для этого нажмите « Файл» > «Параметры» > «Дополнительно », прокрутите вниз до раздела « При расчете этой книги» и поставьте галочку в поле «Использовать систему дат 1904».

Нажмите OK , чтобы сохранить новые настройки, и теперь отрицательные величины времени будут отображаться правильно, как отрицательные числа:

Как видите, время начала больше, чем время окончания, и результат получен со знаком «минус».

Способ 2. Рассчитать отрицательное время в Excel с помощью формул

Если изменить систему дат по умолчанию в Excel нецелесообразно, вы можете заставить отрицательное время отображаться правильно, используя одну из следующих формул:

=ЕСЛИ(A2-B2>0; A2-B2; «-» & ТЕКСТ(ABS(A2-B2);»ч:мм»))

=ЕСЛИ(A2-B2>0; A2-B2; ТЕКСТ(ABS(A2-B2);»-ч:мм»))

Они обе проверяют, является ли отрицательной разница во времени (A2-B2). Если она меньше нуля, первая формула вычисляет абсолютное значение (без учёта знака) и объединяет этот результат со знаком «минус». Вторая формула делает точно такой же расчет, но использует отрицательный формат времени «-ч::мм «.

Примечание. Имейте в виду, что в отличие от первого метода, который обрабатывает отрицательное время как отрицательное число, результатом функции ТЕКСТ всегда является текстовая строка, которую нельзя использовать в математических вычислениях.

Если же текстовый формат для вас нежелателен, то вы можете определить разницу во времени в абсолютном выражении, игнорируя знаки.

На случай если время окончания меньше, чем время начала, мы можем проверить это при помощи функции ЕСЛИ.

=ЕСЛИ(B2<A2;B2+1;B2)-A2

Если разница во времени отрицательная, ко времени окончания добавляем 1 день (24 часа).  В результате получим правильную разницу во времени, но без знака «минус».

Сложение и вычитание времени в Excel

По сути, есть 2 способа сложения и вычитания времени в Excel:

  • При помощи функции ВРЕМЯ.
  • Применяя арифметические вычисления, основанные на количестве часов (24), минут (1440) и секунд (86400) в одних сутках.

Функция ВРЕМЯ(часы; минуты; секунды) делает вычисления времени в Excel очень простыми, однако не позволяет добавлять или вычитать более 23 часов, 59 минут или 59 секунд. 

Если вы работаете с большими временными интервалами, то используйте один из способов, описанных ниже.

Как добавить или вычесть часы

Чтобы добавить часы к заданному времени в Excel, вы можете взять на вооружение одну из следующих формул.

Функция ВРЕМЯ для добавления до 24 часов

Время начала + ВРЕМЯ( N часов ; 0 ; 0)

Например, если ваше время начала записано в ячейке A2, и вы хотите добавить к нему 2 часа, формула выглядит следующим образом:

=A2 + ВРЕМЯ(4; 0; 0)

Примечание. Если вы попытаетесь добавить более 23 часов с помощью функции ВРЕМЯ, указанные часы будут разделены на 24, а остаток от деления будет добавлен к времени начала. Например, если вы попытаетесь добавить 28 часов к «10:00» (ячейка A2) с помощью формулы =A4 + ВРЕМЯ(28; 0; 0), результатом будет «14:00», т. е. A2 + 4 часа.

Как добавить любое количество часов (меньше или больше 24 часов)

Следующая формула не имеет ограничений на количество часов, которые вы хотите добавить:

Время начала + ( N часов / 24)

Например, чтобы добавить 36 часов к времени начала в ячейке A2:

=A2 + (36/24)

Чтобы вычесть часы из заданного времени, вы используете аналогичные формулы и просто заменяете «+» знаком «-»:

Например, чтобы вычесть 40 часов из времени в ячейке A2, можно употребить формулу:

=A2-(40/24)

Если вычитаем менее чем 24 часа, то используйте функцию ВРЕМЯ:

=A2 — ВРЕМЯ(4; 0; 0)

Как прибавить или вычесть минуты

Чтобы добавить минуты к заданному времени, используйте те же методы, которые мы только что использовали для добавления часов.

Чтобы добавить или вычесть менее 60 минут

Используйте функцию ВРЕМЯ и укажите минуты, которые вы хотите добавить или вычесть, во втором аргументе:

Время начала + ВРЕМЯ(0; N минут ; 0)

Вот несколько примеров для расчета минут в Excel:

Чтобы добавить 30 минут ко времени в A2:  =A2 + ВРЕМЯ(0;30;0)

Чтобы вычесть 50 минут из времени в A2:     =A2 — ВРЕМЯ(0;50;0)

Как добавить или вычесть более 60 минут

При расчете разделите количество минут на 1440, то есть на количество минут в сутках, и прибавьте получившееся число к времени начала:

Время начала + ( N минут / 1440)

Чтобы вычесть минуты из времени, просто замените плюс знаком минус. Например:

Чтобы добавить 600 минут:     =A2 + (600/1440)

Чтобы вычесть 600 минут:        =A2 — (600/1440)

Как прибавить или вычесть секунды

Подсчеты с секундами в Excel выполняются аналогичным образом как с минутами. Ограничение здесь, как вы понимаете, 60 секунд.

Чтобы добавить менее 60 секунд к заданному времени, вы можете использовать функцию ВРЕМЯ:

Время начала + ВРЕМЯ(0; 0; N секунд )

Чтобы добавить более 59 секунд, используйте следующую формулу:

Время начала + ( N секунд / 86400)

86400 – это количество секунд в сутках.

Чтобы вычесть секунды, используйте те же формулы, только со знаком минус (-) вместо плюса (+).

Это может выглядеть примерно так:

Чтобы добавить 50 секунд к A2:         =A2 + ВРЕМЯ(0;0;50)

Чтобы добавить 1500 секунд к A2:      =A2 + (1500/86400)

Чтобы вычесть 25 секунд из A2:          =A2 — ВРЕМЯ(0;0;25)

Чтобы вычесть 2500 секунд из A2:      =A2 — (2500/86400)

Примечание:

  • Если вычисленное время отображается в виде десятичного числа, примените настраиваемый формат даты/времени к ячейкам.
  • Если после применения пользовательского форматирования в ячейке отображается #########, то скорее всего, ячейка недостаточно широка для отображения даты и времени. Чтобы исправить это, увеличьте ширину столбца, дважды щелкнув или перетащив правую его границу.

Как суммировать время в Excel

Формула суммирования времени в Excel — это обычная функция СУММ, и применение правильного формата времени к результату — это то, что помогает получить верный результат.

Предположим, у вас есть сведения об отработанном времени в столбце B, и вы хотите его суммировать, чтобы посчитать общее количество рабочих часов за неделю. Вы пишете простую формулу СУММ 

=СУММ(B2:B8)

 Затем устанавливаете в ячейке нужный формат времении получаете результат, как на скриншоте ниже.

В некоторых случаях формат времени по умолчанию работает просто отлично, но иногда вам может понадобиться более тонкая настройка шаблона, например, для отображения общего времени в виде минут и секунд или только секунд. Хорошей новостью является то, что никаких других вычислений не требуется. Все, что вам нужно сделать, это применить правильный формат времени к ячейке.

Щелкните правой кнопкой мыши ячейку и выберите «Формат ячеек» в контекстном меню или нажмите Ctrl + 1, чтобы открыть диалоговое окно «Формат ячеек». Выберите «Пользовательский» и введите один из следующих форматов времени в поле «Тип»:

  • Чтобы отобразить общее время в часах и ​​минутах: [ч]:мм
  • Чтобы отобразить общее время в минутах и ​​секундах: [м]:сс
  • Чтобы отобразить общее время в секундах: [сс]

Примечание. Вышеупомянутые пользовательские форматы времени работают только для положительных значений. Если результатом ваших расчетов времени является отрицательное число, например, когда вы вычитаете большее время из меньшего, результат будет отображаться как #####. Чтобы по-другому отображать отрицательное время, см. раздел Пользовательский формат для отрицательных значений времени .

Кроме того, имейте в виду, что формат времени, примененный к ячейке, изменяет только представление на дисплее, не изменяя содержимое ячейки.  На самом деле это обычное время, которое хранится в виде десятичной дроби во внутренней системе Excel. Это означает, что вы можете свободно ссылаться на него в других формулах и вычислениях.

Вот как вы можете рассчитывать время в Excel. Чтобы узнать о других способах управления датами и временем в Excel, я рекомендую вам ознакомиться с ресурсами в конце этой статьи. Я благодарю вас за чтение и надеюсь увидеть вас в нашем блоге. 

Как перевести время в число В статье рассмотрены различные способы преобразования времени в десятичное число в Excel. Вы найдете множество формул для преобразования времени в часы, минуты или секунды. Поскольку Microsoft Excel использует числовую систему для работы с временем, вы можете…
Формат времени в Excel Вы узнаете об особенностях формата времени Excel, как записать его в часах, минутах или секундах, как перевести в число или текст, а также о том, как добавить время с помощью…
Как вывести месяц из даты На примерах мы покажем, как получить месяц из даты в таблицах Excel, преобразовать число в его название и наоборот, а также многое другое. Думаю, вы уже знаете, что дата в…
Как быстро вставить сегодняшнюю дату в Excel? Это руководство показывает различные способы ввода дат в Excel. Узнайте, как вставить сегодняшнюю дату и время в виде статической метки времени или динамических значений, как автоматически заполнять столбец или строку…
Количество рабочих дней между двумя датами в Excel Довольно распространенная задача: определить количество рабочих дней в период между двумя датами – это частный случай расчета числа дней, который мы уже рассматривали ранее. Тем не менее, в Excel для…

Понравилась статья? Поделить с друзьями:
  • Timing another word for
  • Timestamp to datetime excel
  • Timestamp in vba excel
  • Times this word before
  • Times that word before