+ Reply to Thread
Results 1 to 12 of 12

NOON for 12:00 PM

  1. #1
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    NOON for 12:00 PM

    How should the formula read to check the TIME value of a certain cell for 12:00 PM?
    If the TIME in the referenced cell is 12:00 PM...return NOON.

    Here is what I have...and it doesn't work:

    Please Login or Register  to view this content.
    Last edited by HuskerBronco; 12-14-2008 at 06:19 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    That formula should work assuming Data!C12 contains just a time.

    What's in C12, is it generated by a formula?

  3. #3
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167
    What's in C12, is it generated by a formula?
    When I select the cell, this is what shows in the formula bar:

    Please Login or Register  to view this content.
    The cell (C12) is TIME formatted, and the time entered comes from a drop-down list containing all times from 10:00 AM to 11:00 PM...incremented every 30 minutes.
    The NAMED RANGE that the drop-down list comes from DID contain formulas...but I overwrote them with TIME values...and it still didn't work.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Format C12 as General and what do you see?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Excel sometimes behaves oddly when you increment times like that. I can't replicate the specific problem, though. What formula did you use to increase the time by 30 minutes?

    Try using this version

    =IF(TEXT(DATA!C12,"h:mm")="12:00","NOON",DATA!C12)

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607
    I just tried your formula and it worked for me. You said that "... it doesn't work ..." so what do you see instead of "NOON"? Also, if the time in C12 is supposedly 12:00:00 and you temporarily change the cell format to numeric is it 0.50000? If you change the formula to:
    Please Login or Register  to view this content.
    what does it display?
    Ben Van Johnson

  7. #7
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167
    Format C12 as General and what do you see?
    In the formula bar... 0.499999998666667

    And...it still says 12:00 PM in the target cell. (Not NOON)

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Well -- that's not noon.

    You could use DLL's suggestion, or fix the drop-down ...

  9. #9
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167
    What formula did you use to increase the time by 30 minutes?
    In cell A1 of the NAMED RANGE "Times" I have 10:00 AM.
    Cell A2 contains the following formula:
    Please Login or Register  to view this content.
    The formula in A2 was then copied down enough cells to display 11:00 PM as the last time.
    I haven't got a clue why this wasn't giving me a .5 for 12:00 PM (but rather...0.499999998666667).

    Try using this version

    =IF(TEXT(DATA!C12,"h:mm")="12:00","NOON",DATA!C12)
    This formula, on the other hand, worked perfectly....!!!
    Thank you, so much for your help.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I haven't got a clue why this wasn't giving me a .5 for 12:00 PM
    Because repeating decimals can't be exactly represented.

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Quote Originally Posted by HuskerBronco View Post
    Cell A2 contains the following formula:
    Please Login or Register  to view this content.
    Better to use

    =A1+"0:30"

    or

    =A1+TIME(0,30,0)

  12. #12
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167
    Better to use =A1+"0:30" or =A1+TIME(0,30,0)
    So...that was my problem the whole time.

    I switched the formula in Cell A2 to =A1+TIME(0,30,0)...and copied it down.
    Then I used the new drop-down menu to enter the time in each cell from C1 down.

    Finally, I reverted to my original formula in the target cells...and it worked exactly as I needed it to!!!

    Didn't think this would be so difficult...

    Thanks for all of your help...guys.
    Last edited by HuskerBronco; 12-15-2008 at 08:32 AM. Reason: Typo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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