+ Reply to Thread
Results 1 to 9 of 9

Counting time formula

  1. #1
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Counting time formula

    Hello All,

    Can you please help me with the formula wchich will count the times. I mean if for example in A1 i will have 08:30:00 PM and A2 06:10:00 AM i want in A3 formula to tell me how many hours its. Also i possible i would like in number format instead of time so for example it will say it was 8,5. i have attached the sheet as well and i need this formula from E39 - E58
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Counting time formula

    Hi,

    One way in D40 etc..

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Re: Counting time formula

    Thank you very much

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Counting time formula

    Why 8.5? In case of rounding to nearest 30 minutes: 9h40 to 9h30, 9h50 to 10h00
    E44:
    =MROUND((D44-C44+(C44>D44))*24,0.5)
    Quang PT

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Counting time formula

    Re #2. Sorry, that was of course a typo. I should have said 'in E40', but I guess you probably realised that.

  6. #6
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Re: Counting time formula

    Thanks guys i does work but one more question, i have added to take off 0.5 as and half hour but is there any way i can add like in =IFERROR(((D44-C44+IF(D44<C44,1,0))*24)-0.5,) when C44 or D44 blank leave us 0, because it taking 0,5 if there isnt anything there.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Counting time formula

    May be:
    Both blank returns 0
    Any of both blank returns 0.5
    Else, subtract.

    =IF(AND(C44="",D44=""),0,IF(OR(C44="",D44=""),0.5,(D44-C44+(C44>D44))*24))

  8. #8
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Re: Counting time formula

    it doesnt work unfortunetaly

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Counting time formula

    Could you give few desired results in the sample?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hourly Time & not double counting time
    By jmcgurl in forum Excel General
    Replies: 14
    Last Post: 11-11-2015, 12:17 AM
  2. [SOLVED] Counting values in a time range - when the time range crosses midnight
    By dlocos in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-24-2014, 04:27 AM
  3. [SOLVED] Counting when a Time is within 30 minutes of a time in a different Column
    By danieloverton1984 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-27-2013, 03:53 PM
  4. Help with counting how many are within a time range, for a specific time
    By snswilliams in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-29-2013, 02:19 PM
  5. Replies: 6
    Last Post: 02-04-2012, 06:57 PM
  6. Counting time within time periods!
    By thegooser123 in forum Excel General
    Replies: 8
    Last Post: 09-06-2011, 08:33 PM
  7. Formula for counting date & time range
    By excelbry in forum Excel General
    Replies: 10
    Last Post: 06-07-2011, 08:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1