+ Reply to Thread
Results 1 to 3 of 3

using IF with times

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-20-2012
    Location
    Derby
    MS-Off Ver
    Excel 2010
    Posts
    383

    using IF with times

    Hi All,

    I have a set of cells that are between two times, 6am and 10pm. I want to create a formula that says if cell a1 is between 6am and 10pm, then show "P", but I'm not sure how to do it.

    Any advice?

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

    Re: using IF with times

    try:
    =IF(AND(A1>=6/24,A1<=22/24),"P","")

    or if it contains dates:
    =IF(AND(MOD(A1,1)>=6/24,MOD(A1,1)<=22/24),"P","")

    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
    06-20-2012
    Location
    Derby
    MS-Off Ver
    Excel 2010
    Posts
    383

    Re: using IF with times

    Perfect. Thank you

+ 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. If a search term can be found 1 time, 2 times 3 times 4 times 5 times
    By excelcandy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2013, 09:57 PM
  2. [SOLVED] calculate turn around times range of times for weekday and weekend
    By xrayexceller in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-28-2013, 02:22 PM
  3. Macro Loop – Find Specific Times, Extract Date, Average Values of Times
    By ExcelQuestFL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-25-2010, 02:50 PM
  4. Macro to help sort date - times and average similar times.
    By ferretydeath in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2008, 05:44 PM
  5. [SOLVED] capture:How are relay leg times or driving times entered and totaled?
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 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