+ Reply to Thread
Results 1 to 5 of 5

=Hour equation not working

Hybrid View

  1. #1
    Registered User
    Join Date
    08-17-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    7

    =Hour equation not working

    Hi Everyone,

    I've formatted a column of times to a time format. Now I want to use the =hour equation, but I keep getting a "#Value!" message. I've tried every time format with no success. Hopefully someone can help me out, I'm driving myself crazy trying to solve this problem.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,460

    Re: =Hour equation not working

    I put =ISTEXT(A2) into C2, and the result was TRUE, indicating that these are text strings that look like times and not true time serial values. You will need to use the TIMEVALUE() function to convert the text time to a serial number, inside of the HOUR() function. =HOUR(TIMEVALUE(A2))
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    08-17-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    7

    Re: =Hour equation not working

    Quote Originally Posted by MrShorty View Post
    I put =ISTEXT(A2) into C2, and the result was TRUE, indicating that these are text strings that look like times and not true time serial values. You will need to use the TIMEVALUE() function to convert the text time to a serial number, inside of the HOUR() function. =HOUR(TIMEVALUE(A2))
    Thank you! That worked perfectly!

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,460

    Re: =Hour equation not working

    I'm glad that worked. As I looked closer at your time values, I noticed that each value includes a leading and a trailing space, which, I expect, is part of why Excel had difficulty automatically detecting these as time values. You have not stated where these data are coming from, but, if the source puts leading/trailing spaces in the data, it is possible that other non-printing characters could also be included, possibly causing other difficulties with using these values. It may be worth the effort to explore the different possibilities and see if different text functions/strategies may be needed for other data sets to correctly convert these text strings to time values.

  5. #5
    Registered User
    Join Date
    08-17-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    7

    Re: =Hour equation not working

    Quote Originally Posted by MrShorty View Post
    I'm glad that worked. As I looked closer at your time values, I noticed that each value includes a leading and a trailing space, which, I expect, is part of why Excel had difficulty automatically detecting these as time values. You have not stated where these data are coming from, but, if the source puts leading/trailing spaces in the data, it is possible that other non-printing characters could also be included, possibly causing other difficulties with using these values. It may be worth the effort to explore the different possibilities and see if different text functions/strategies may be needed for other data sets to correctly convert these text strings to time values.
    Thanks for bringing this to my attention. I will definitely look into it.

+ 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. [SOLVED] Formula to convert 24 hour day to 8 hour (working) day?
    By miro2021 in forum Excel General
    Replies: 4
    Last Post: 07-31-2017, 10:06 AM
  2. how many employee working per hour
    By Mduntley in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-19-2015, 04:40 PM
  3. Replies: 4
    Last Post: 10-02-2015, 10:00 AM
  4. Replies: 3
    Last Post: 05-14-2015, 07:32 AM
  5. Calculate employees working from hour to hour
    By otter in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-03-2014, 08:57 AM
  6. [SOLVED] Working out Calls Per Hour. 8 Hour Day.
    By sturmy in forum Excel General
    Replies: 3
    Last Post: 03-24-2014, 11:05 AM
  7. Hour equation with long date/time
    By caryno in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-14-2008, 10:17 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