+ Reply to Thread
Results 1 to 6 of 6

how to create nested if function for military time

  1. #1
    Registered User
    Join Date
    08-31-2013
    Location
    brampton, canada
    MS-Off Ver
    Excel 2010
    Posts
    13

    Question how to create nested if function for military time

    cell A1 has military time, 04:25:00
    how to create a nested if function if the value of time in A1 is between 07:00:00 and 15:00:00, then B1 should display "a"; if the value of time in A1 is between 15:00:00 and 23:00:00, then B1 should display "b";if the value of time in A1 is between 23:00:00 and 07:00:00, then B1 should display "c";

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,405

    Re: how to create nested if function for military time

    A B C D E
    4:25:00 c 0:00:00 c
    7:00:00 a
    15:00:01 b
    23:00:00 c


    B2=VLookup($A2;$D$2:$E$5;2;1)
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    7,252

    Re: how to create nested if function for military time

    If A1 has time use

    Please Login or Register  to view this content.

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

    Re: how to create nested if function for military time

    Your intervals are not well defined. They overlap.

    between 07:00:00 and 15:00:00, then B1 should display "a"
    between 15:00:00 and 23:00:00, then B1 should display "b"
    between 23:00:00 and 07:00:00, then B1 should display "c"

    If A1 = 15:00 what result do you expect? "A" or "B"?

    If A1 = 23:00 what result do you expect? "B" or "C"?

    If A1 = 7:00 what result do you expect? "C" or "A"?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    08-31-2013
    Location
    brampton, canada
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: how to create nested if function for military time

    Appreciate your help. Thanks

  6. #6
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: how to create nested if function for military time

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Nested If Function, using 'AND' and 'OR' at the same time
    By jonmel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-25-2013, 09:55 AM
  2. Simple way to convert military time to standard where military has no colon
    By salvator in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2011, 10:27 AM
  3. Show timesheet time in and out in regular time versus military tim
    By John in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-11-2005, 01:20 AM
  4. Concatenate Function/converting military time to AM/PM
    By brianwakin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2005, 03:05 PM
  5. military time function
    By Beth in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-08-2005, 01: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