+ Reply to Thread
Results 1 to 7 of 7

If Formula Based on Current Time

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    If Formula Based on Current Time

    Can anyone help me make this formula work? I want the formula to display 1,2, or 3 depending on the time. This is the basic logic but the syntax is all wrong.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: If Formula Based on Current Time

    =IF(NOW()<TODAY()+TIMEVALUE("10:00"),1,IF(NOW()<TODAY()+TIMEVALUE("15:00"),2,3))

    Regards

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

    Re: If Formula Based on Current Time

    Use a cell to hold the current time.

    A1: =NOW()

    Format as Time h:mm

    Then:

    =IF(HOUR(A1)<10,1,IF(HOUR(A1)<15,2,3))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: If Formula Based on Current Time

    Nice, Tony. Your moniker is certainly justified by that one! And my response a little humbled!
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

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

    Re: If Formula Based on Current Time

    Thanks!

  6. #6
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: If Formula Based on Current Time

    I like both solutions. Thanks

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

    Re: If Formula Based on Current Time

    You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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