+ Reply to Thread
Results 1 to 14 of 14

Timevalue of Now

  1. #1
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Timevalue of Now

    I'm trying to get the current TIMEVALUE. So I'd like a number between 0 and 1 representing the day's time. TIMEVALUE(NOW()), to my surprise, does not work. I have searched to no avail. How can I do this? Thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Timevalue of Now

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    formatted as time.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Timevalue of Now

    Or this

    =MOD(NOW(),1)
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: Timevalue of Now

    Huh, so there's really no direct way to do it other than rounding. I just think that's weird. Thanks for the quick help to both of you.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Timevalue of Now

    That's not rounding. NOW() is the date plus the time. The integer part is the number of days counting from 01/01/1900 and the fractional part is the part of a day, that is, the time.

    TIMEVALUE takes a string that looks like a time and converting it into a true numeric value representing the time.

  6. #6
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: Timevalue of Now

    INT function - "Rounds a number down to the nearest integer."

    Sounds like rounding to me. Thanks for the help.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Timevalue of Now

    The formula is taking the integer part of the NOW() value from the total NOW() value.

    Rounding would be reducing the number of decimal places in the output value, whereas this is leaving you with only the decimal places.

    So, OK, the first part is rounding but, overall, it's not. Is rounding a problem for you?

    TIMEVALUE doesn't give you what you want

    Anyway, thanks for the rep

  8. #8
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: Timevalue of Now

    Well obviously I didn't mean rounding the output, that wouldn't get me what I want! I thought of that when I was trying to figure out a way, but thought I might be missing something with the date formatting. (Google Sheets, which I was just using, returns what I'm looking for with TIMEVALUE(NOW()) )

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Timevalue of Now

    OK,I'm done. I'll leave it with you.

  10. #10
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Timevalue of Now

    Just tested:

    =TIMEVALUE(NOW()) in Google sheets produces the same result as =MOD(NOW(),1)

    If you want to to use =TIMEVALUE(NOW()) in excel use it like the formula below


    =TIMEVALUE(TEXT(NOW(),"m/d/yyyy h:mm:ss"))

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Timevalue of Now

    In Excel the TIMEVALUE function doesn't work on numbers which is what the NOW() function returns.

    NOW() returns the date and time which is a numeric value.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Timevalue of Now

    Quote Originally Posted by AlKey View Post
    =TIMEVALUE(TEXT(NOW(),"m/d/yyyy h:mm:ss"))
    The date portion is not needed:

    =TIMEVALUE(TEXT(NOW(),"h:mm:ss"))

    And, the TIMEVALUE function is not needed:

    =--TEXT(NOW(),"h:mm:ss")

  13. #13
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: Timevalue of Now

    Thanks AlKey and Tony, that's closer to what I was originally looking for and it explains why I couldn't get it to work. They all work the same, though, thanks!

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Timevalue of Now

    You're welcome. We appreciate the feedback!

+ 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. Timevalue help with spreadsheets
    By tlindstrom in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-21-2014, 03:27 PM
  2. Timevalue
    By merl4 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-02-2013, 08:40 AM
  3. How to sum specific timevalue in row?
    By k9aland in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-23-2012, 03:07 PM
  4. timevalue
    By tomfromportage in forum Excel General
    Replies: 2
    Last Post: 03-24-2012, 05:20 PM
  5. Ontime Now + TimeValue
    By trinn89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2011, 07:53 PM
  6. Vlookup with on TimeValue
    By mangesh in forum Excel General
    Replies: 4
    Last Post: 12-24-2010, 05:03 AM
  7. [SOLVED] iserror(Timevalue())
    By Basil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-05-2005, 09:06 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