How to use the MINUTE function
What is the MINUTE function?
The MINUTE function returns a whole number that represents the minute based on an Excel time value. The returned number is an integer between 0 (zero) and 59.
Table of Contents
1. Introduction
What is an integer?
An integer is a whole number that can be positive, negative, or zero, but not a fraction or decimal. Excel can't calculate the minute based on negative integers.
What is an Excel time value?
Excel time is actually a decimal number ranging between 0 and 1 in Excel and then formatted as time.
For example, 12:00 PM is represented as 0.5 because it is half of a day, you can verify this by typing 12:00 PM in a cell and then change the cell formatting to general. This will show the value as Excel interprets it.
How does Excel recognize time values?
Excel recognizes certain text strings like "6:45 PM" as valid time values. A recognized time value is right aligned in the cell just like a regular number, shown in the image below in cell B2.
A time number that is not recognized is left aligned which is demonstrated in cell B4 in the image above. This visual feedback lets you easily spot values that need closer inspection.
What is a minute in an Excel time value?
There are 60 minutes in one hour and 24 hours in one day. 60 * 24 = 1440 minutes in one day.
1/1440 or approx. 0.000694 represents one minute in Excel time value. Excel uses a number 0 <= x <= 1 in decimal form to represent time in an Excel worksheet. 0 is zero minutes and 1 is 1440 minutes (24 hours).
Why is 1 day equal to 1440 minutes?
This has to do how Excel handles dates. Each date is represented by an integer and one day is equal to 1 in Excel. There are 24 hours or 1440 minutes in one day.
Dates are stored numerically but formatted to display in human-readable date/time formats, this enables Excel to do work with dates in calculations.
For example, dates are stored as sequential serial numbers with 1 being January 1, 1900 by default. The integer part (whole number) represents the date the decimal part represents the time.
This allows dates to easily be formatted to display in many date/time formats like mm/dd/yyyy, dd/mm/yyyy and so on and still be part of calculations as long as the date is stored numerically in a cell.
You can try this yourself, type 10000 in a cell, press CTRL + 1 and change the cell's formatting to date, press with left mouse button on OK. The cell now shows 5/18/1927.
Related functions
Excel Function | Description |
---|---|
HOUR(time) | Returns the hour portion of a time value |
MINUTE(time) | Returns the minute portion of a time value |
SECOND(time) | Returns the second portion of a time value |
TIME(hour,minute,second) | Creates a time value from hour, minute, and second values |
TIMEVALUE(time_text) | Converts a text time to a serial time value |
2. Syntax
MINUTE(serial_number)
serial_number | Required. An Excel time value that you want to extract the minute from. |
3. Example 1
This example demonstrates the MINUTE function in cell C3, it extracts the minute from the Excel time value specified in cell B3: "1:34:22 PM"
Formula in cell C3:
The MINUTE function returns 34.
Formula in cell C4:
The formula in cell C4 extracts the minutes from the time 1:53:05 PM, which is 53 minutes.
Formula in cell C5:
The formula in cell C5 extracts the minutes from the time 10:45:35 AM, which is 45 minutes.
Formula in cell C6:
The formula in cell C6 extracts the minutes from the time 5:25:15 PM, which is 25 minutes.
Formula in cell C7:
The formula in cell C7 extracts the minutes from the time 12:16:22 AM, which is 16 minutes.
In each case, the MINUTE function is used to extract just the minutes portion from the time value in column B, ignoring the hours and seconds.
4. Example 2
Steven starts walking at 12:05 PM and arrives at the destination at 2:10 PM. How many minutes did the walk take?
What we know:
- Start time: 12:05 PM
- End time: 2:10: PM
- Excel time values are decimal values between 0 (zero) and 1. This allows us to perform calculations to Excel time values.
In Excel, one day represents a value of 1. Since a day contains 24 hours, one hour is represented as 1/24 of a day. One minute is 1/(24*60) of a day, as there are 60 minutes in an hour and 24 hours in a day.
Formula in cell C5:
This formula calculates the difference between the time value in cell C3 and B3. This value is displayed in hours, minutes, and seconds, however, it is possible to format the output value to show only minutes even if it is larger than 59 which is the default limit.
This is done by applying cell formatting to cell C5 using this custom format code: [m] This can be easily accomplished by applying cell formatting.
- Select cell C5.
- Press CTRL + 1 to open the "Format cells" dialog box. The image above shows this dialog box below the formula.
- Select Category: Custom
- Type [m] in the Type: field
- Press the OK button to apply changes.
The image above demonstrates an alternative way to calculate the number of seconds without using cell formatting. Note that the SECOND function is not used at all, it is limited to 59 seconds the most. It can show values equal to 60 or more.
Formula in cell C5:
Here's how it works:
- (C3-B3) - This calculates the time difference between the arrival and departure times. The result will be in the format of a decimal number representing the number of days.
- 60*24 - This converts the decimal number of days into seconds.
- Multiplying by 24 converts the decimal number of days into hours.
- Multiplying by 60 again converts the hours into minutes.
In this specific case, steven started walking at 12:05 PM and arrived at the destination at 2:10 PM. The formula calculates the time difference between these two times, which is 2 hours and 5 minutes. Converted to minutes, this is 125 minutes.
5. Function not working
The MINUTE function returns
- #NUM! error if the decimal is a negative value.
- #VALUE! error if the Excel time value is invalid.
5.1 Troubleshooting the error value
When you encounter an error value in a cell a warning symbol appears, displayed in the image above. Press with mouse on it to see a pop-up menu that lets you get more information about the error.
- The first line describes the error if you press with left mouse button on it.
- The second line opens a pane that explains the error in greater detail.
- The third line takes you to the "Evaluate Formula" tool, a dialog box appears allowing you to examine the formula in greater detail.
- This line lets you ignore the error value meaning the warning icon disappears, however, the error is still in the cell.
- The fifth line lets you edit the formula in the Formula bar.
- The sixth line opens the Excel settings so you can adjust the Error Checking Options.
Here are a few of the most common Excel errors you may encounter.
#NULL error - This error occurs most often if you by mistake use a space character in a formula where it shouldn't be. Excel interprets a space character as an intersection operator. If the ranges don't intersect an #NULL error is returned. The #NULL! error occurs when a formula attempts to calculate the intersection of two ranges that do not actually intersect. This can happen when the wrong range operator is used in the formula, or when the intersection operator (represented by a space character) is used between two ranges that do not overlap. To fix this error double check that the ranges referenced in the formula that use the intersection operator actually have cells in common.
#SPILL error - The #SPILL! error occurs only in version Excel 365 and is caused by a dynamic array being to large, meaning there are cells below and/or to the right that are not empty. This prevents the dynamic array formula expanding into new empty cells.
#DIV/0 error - This error happens if you try to divide a number by 0 (zero) or a value that equates to zero which is not possible mathematically.
#VALUE error - The #VALUE error occurs when a formula has a value that is of the wrong data type. Such as text where a number is expected or when dates are evaluated as text.
#REF error - The #REF error happens when a cell reference is invalid. This can happen if a cell is deleted that is referenced by a formula.
#NAME error - The #NAME error happens if you misspelled a function or a named range.
#NUM error - The #NUM error shows up when you try to use invalid numeric values in formulas, like square root of a negative number.
#N/A error - The #N/A error happens when a value is not available for a formula or found in a given cell range, for example in the VLOOKUP or MATCH functions.
#GETTING_DATA error - The #GETTING_DATA error shows while external sources are loading, this can indicate a delay in fetching the data or that the external source is unavailable right now.
5.2 The formula returns an unexpected value
To understand why a formula returns an unexpected value we need to examine the calculations steps in detail. Luckily, Excel has a tool that is really handy in these situations. Here is how to troubleshoot a formula:
- Select the cell containing the formula you want to examine in detail.
- Go to tab “Formulas” on the ribbon.
- Press with left mouse button on "Evaluate Formula" button. A dialog box appears.
The formula appears in a white field inside the dialog box. Underlined expressions are calculations being processed in the next step. The italicized expression is the most recent result. The buttons at the bottom of the dialog box allows you to evaluate the formula in smaller calculations which you control. - Press with left mouse button on the "Evaluate" button located at the bottom of the dialog box to process the underlined expression.
- Repeat pressing the "Evaluate" button until you have seen all calculations step by step. This allows you to examine the formula in greater detail and hopefully find the culprit.
- Press "Close" button to dismiss the dialog box.
There is also another way to debug formulas using the function key F9. F9 is especially useful if you have a feeling that a specific part of the formula is the issue, this makes it faster than the "Evaluate Formula" tool since you don't need to go through all calculations to find the issue..
- Enter Edit mode: Double-press with left mouse button on the cell or press F2 to enter Edit mode for the formula.
- Select part of the formula: Highlight the specific part of the formula you want to evaluate. You can select and evaluate any part of the formula that could work as a standalone formula.
- Press F9: This will calculate and display the result of just that selected portion.
- Evaluate step-by-step: You can select and evaluate different parts of the formula to see intermediate results.
- Check for errors: This allows you to pinpoint which part of a complex formula may be causing an error.
The image above shows cell reference B3 converted to hard-coded value using the F9 key. The MINUTE function requires numerical values larger than or equal to 0 (zero) which is not the case in this example. We have found what is wrong with the formula.
Tips!
- View actual values: Selecting a cell reference and pressing F9 will show the actual values in those cells.
- Exit safely: Press Esc to exit Edit mode without changing the formula. Don't press Enter, as that would replace the formula part with the calculated value.
- Full recalculation: Pressing F9 outside of Edit mode will recalculate all formulas in the workbook.
Remember to be careful not to accidentally overwrite parts of your formula when using F9. Always exit with Esc rather than Enter to preserve the original formula. However, if you make a mistake overwriting the formula it is not the end of the world. You can “undo” the action by pressing keyboard shortcut keys CTRL + z or pressing the “Undo” button
5.3 Other errors
Floating-point arithmetic may give inaccurate results in Excel - Article
Floating-point errors are usually very small, often beyond the 15th decimal place, and in most cases don't affect calculations significantly.
'MINUTE' function examples
Functions in 'Date and Time' category
The MINUTE function function is one of 22 functions in the 'Date and Time' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form