Round time to nearest 15min interval in Excel

前端 未结 11 2345
伪装坚强ぢ
伪装坚强ぢ 2020-12-30 03:20

I\'ve an excel spreadsheet with a column which has the date and time of a particular event. I would like to round this to the nearest 15 minute interval so that I can count

相关标签:
11条回答
  • 2020-12-30 03:26

    If you want to round to the Nearest 15:

    Assuming your time is in cell A2

    We'll put our new time into B2:

    B2 =TIME(HOUR(A2), ROUND((MINUTE(A2)/60)*4, 0) * 15, 0)
    

    If you wanted to always round up or down you replace ROUND with ROUNDUP or ROUNDDOWN

    0 讨论(0)
  • 2020-12-30 03:27

    simple:

    • if rounded up =CEILING(A1,"00:15")
    • if rounded down =FLOOR(A1, "00:15")

    Where A1 is the difference between the two time. It can be a reference or calculations: =CEILING(C2-B2,"00:15"), where C2 is the end time and B2 is the start time.

    0 讨论(0)
  • 2020-12-30 03:29

    Date and time rounded to nearest 15-minute period (you can always round up/round down using something like INT):

    =DATE(YEAR(B1),MONTH(B1),DAY(B1))+TIME(HOUR(B1), ROUND(MINUTE(B1)/15,0)*15, 0)
    

    Assuming cell B1 contains the date time to be rounded. This will return the number in typical serial date fashion (e.g. 39846.64444 = 02/02/2009 15:28) and you need to format your result cell as a date/time to see the value (as with all solutions to this problem). Showing date and time together is not a standard Date or Time format, you need a Custom format to do this.

    0 讨论(0)
  • 2020-12-30 03:31

    Since you said you also want the date, how about this:

    = (ROUND((A1 * 1440) / 15, 0) * 15) / 1440

    Assuming that A1 has the date/time value you want. This takes advantage of the fact that date/time columns in Excel are just numbers (integer portion is the date, fractional portion is the time)

    0 讨论(0)
  • 2020-12-30 03:31

    Assuming you have 2 date-times and you want to find the total and round up to the nearest 15 minutes:

    A1 = 7/10/2014 16:10    
    A2 = 7/10/2014 17:49
    

    First get the total in decimal hours:

    A3:   =(A2-A1)*24
    

    Then you can round up to the nearest quarter hour:

    A4:  =Ceiling(A3, .25)
    

    Or do it all on one cell:

    A3:  =Ceiling((A2-A1)*24, .25)
    
    0 讨论(0)
  • 2020-12-30 03:35

    Keep it simple. Rounds to the closest 15 minute interval.

    = ROUND(B2 * 24 * 4, 0) / 4 / 24
    
    0 讨论(0)
提交回复
热议问题