The Excel MINUTE Function
- Summary
The MINUTE function returns the number of minutes in a given time value. For example, if the time value is “10:30 AM”, the function extracts 30 minutes.
- Return Values
0 to 59 (in number format).
- Syntax
=MINUTE (serial_number)
- Arguments
Argument | Required/Optional | Explanation |
---|---|---|
serial_number | Required | A valid time value |
Example 1 – Extracting Minutes from Time Values Using the MINUTE Function
This is the sample dataset.
Steps:
- Select D5.
- Enter the following formula.
=MINUTE(B5)
- Press Enter.
- Drag down the Fill Handle to see the result in the rest of the cells.
- To find the current minutes in D13, enter the following formula.
=MINUTE(NOW())
- Press Enter.
Example 2 – Combine the TIME and MINUTE Functions in Excel
Steps:
- Select C5.
- Enter the following formula.
=TIME(7,MINUTE(B5),0)
- Press Enter.
- Drag down the Fill Handle to see the result in the rest of the cells.
Example 3 – Using the Excel MINUTE Function with IF Statements
Steps:
- Select C5.
- Enter the following formula.
=IF(MINUTE(B5)<30,B5,0)
- Press Enter.
- Drag down the Fill Handle to see the result in the rest of the cells.
Formula Breakdown
IF(MINUTE(B5)<30,B5,0): if the minute value in B5 is less than 30, it will return the time value in B5. Otherwise, It will return zero. The output is 25.
Example 4 – Calculate Time in Excel using the MINUTE Function
To find the end time of a session, knowing its starting time and duration in minutes:
Steps:
- Select C5.
- Enter the following formula.
=TIME(HOUR(B5),MINUTE(B5)+C5,SECOND(B5))
- Press Enter.
- Drag down the Fill Handle to see the result in the rest of the cells.
Example 5 – Use the MINUTE Function to Compute Difference in Minutes
The dataset showcases starting and ending times.
Steps:
- Select C5.
- Enter the following formula.
=TIME(HOUR(B5),MINUTE(B5)+C5,SECOND(B5))
- Press Enter.
- Drag down the Fill Handle to see the result in the rest of the cells.
Example 6 – Using a VBA Code to calculate Minutes in Excel
Steps:
- Go to the Developer tab.
- Select Visual Basic.
- In Insert, select Module.
- Enter the following code.
Sub Minute_Function()
Dim i As Integer
For i = 5 To 12
Cells(i, 4).Value = Minute(Cells(i, 2))
Next i
End Sub
- Close the Visual Basic window.
- Go to the Developer tab.
- Select Macros.
- In the Macro dialog box, select Minute_Function in Macro name.
- Click Run.
This is the output.
VBA Code Breakdown
Sub Minute_Function()
names the sub-procedure.
Dim i As Integer
declares the variable.
For i = 5 To 12
performs a for loop and defines the variable: from 5 to 12.
Cells(i, 4).Value = Minute(Cells(i, 2))
defines the cell to extract the number of minutes. Define the cell from which the number of minutes is extracted.
Next i
denotes the next variable so that the loop starts from the beginning in the next cell.
End Sub
ends the sub-procedure.
Common Errors While Using MINUTE Function
Common Errors | When They Show |
---|---|
#VALUE! | an invalid time format is inserted as a serial number |
Download Practice Workbook
Download the practice workbook.
<< Go Back to Excel Functions | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!