+ Reply to Thread
Results 1 to 11 of 11

Thread: counting hours

  1. #1
    Registered User
    Join Date
    02-26-2010
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    counting hours

    Hi,

    I have been trying to find a formula that will allow me to find out how many time a cretin hour appears in a spread sheet. I can seem to make the blow formula work. Any ideas?



    COUNTIF(B$3:B$142,">=23:00:00<24:00:00") - this would help me count everything between 22:00:00
    Attached Files Attached Files

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,114

    Re: countting hours

    Try

    =COUNTIFS(B$3:B$142,">=23:00:00",B$3:B$142,"<24:00:00")
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    02-26-2010
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: counting hours

    Thanks! looks way better but I am still getting 0's

  4. #4
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,131

    Re: counting hours

    Your times are all stored as text.

    Select each column in turn, Data > Text to Columns, Finish.

    Or select them all, do Alt+F11 to open the VBE, and in the Immediate window, paste Selection.Value = Selection.Value and hit Enter.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,114

    Re: counting hours

    Your time entries in column B to AF are not entered as numbers, but as text.

    You would have to either select column B and go to Data|Text to Columns and click Finish and repeat for each column...

    .. or you would enter a 0 in a blank cell, copy it and to Edit|Paste Special and select Add... but this will enter a 0 in all empty cells in your selection which you would have to clean after...

    the first method, won't put 0's in empty cells, but is more tediious.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  6. #6
    Registered User
    Join Date
    02-26-2010
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: counting hours

    I have selected each column and the selected Data>Text to column>Next >Next>Finish and still no go. Am I missing a step perhaps? I can now see it adding an AM or PM where it should so it should be formatted.

  7. #7
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,114

    Re: counting hours

    Applying shg's much quicker method, I got the attached.

    I put my formula also in AI3
    Attached Files Attached Files
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  8. #8
    Registered User
    Join Date
    03-17-2010
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: counting hours

    This may be oversimplification, but you could do a ctrl+f and (find all) bottom left corner will report how many entries there are.

  9. #9
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,114

    Re: counting hours

    How does that solve the OP's specific question?
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  10. #10
    Registered User
    Join Date
    03-17-2010
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: counting hours

    I understood "find out how many time a cretin hour appears in a spread sheet" to be how many times it appears in any cell in the sheet.

    A find for "4 hours (format not important)" would yield how many times a certain amount cells where "4 hours" appears in the spread sheet.

  11. #11
    Registered User
    Join Date
    03-17-2010
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: counting hours

    my apologies for junking the thread, i did not see his example.

Thread Information

Users Browsing this Thread

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

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.2.0