+ Reply to Thread
Results 1 to 3 of 3

Value Based On A Time Before OR After

  1. #1
    Forum Contributor
    Join Date
    04-29-2017
    Location
    Huntington Beach, California
    MS-Off Ver
    365 business
    Posts
    114

    Value Based On A Time Before OR After

    Hello,
    I have a question in regards of times. I feel like it should pretty simple but I did a let of research and trying but nothing really works out


    Lets say I have times in Column A and based on those times I would like to show either Lunch or Dinner based if the time is passed 3pm.
    for example
    5:34 pm Dinner
    3:23 pm Dinner
    1:23 pm Lunch
    7:00 am Lunch

    Any help is appreciated.
    Thanks,
    Martin

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Value Based On A Time Before OR After

    hi there, martin. Excel recognises dates as integers & time as decimals. to verify, type in 1jan2013 in A1. and 12 pm in B1. Format both cells to General. you will see that A1 is 41275 (meaning 41,275th day from 1 Jan 1900) & B1 is 0.5 (1/2 a day).

    hence, you can check for time by doing:
    =IF(A2>15/24,"Dinner","Lunch")
    15/24 is 3 pm. just like how 12/24 is 12 pm.

    your cells might have contain date too, but formatted to exclude showing it. you would then have to use:
    =IF(MOD(A2,1)>15/24,"Dinner","Lunch")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Contributor
    Join Date
    04-29-2017
    Location
    Huntington Beach, California
    MS-Off Ver
    365 business
    Posts
    114

    Re: Value Based On A Time Before OR After

    Hi Benishiryo,
    Thanks for the help and great explanation.
    Thanks again,
    Martin

+ 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. Replies: 5
    Last Post: 05-09-2018, 12:30 PM
  2. [SOLVED] Calculating a previous work shift time (05:30, or 17:30) based on current time
    By andrew.why in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-20-2017, 09:09 PM
  3. [SOLVED] Weighted Average of Sequential Time Based Data Series Using Start/End Time Input
    By marcoyul in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2017, 12:10 PM
  4. [SOLVED] time sheet help, format TIME and formula based on the actual time entered.
    By bh mng in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-06-2016, 01:10 PM
  5. Creating time sliced Pivot data in Excel based on two time fields
    By swinster in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-06-2016, 08:22 AM
  6. [SOLVED] Formula to fill C5 with a time that makes J5 equal 8 hours based on time put into B5
    By possumbarnes in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-26-2015, 10:08 PM
  7. Calculating END time based on start time, breaks, and hours to complete
    By sweedey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2012, 11:29 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