+ Reply to Thread
Results 1 to 3 of 3

Decimal to Hour conversion WITH Conditional Formatting - Yikes!

  1. #1
    Registered User
    Join Date
    05-18-2011
    Location
    FL
    MS-Off Ver
    Excel 2003 and 2010
    Posts
    1

    Decimal to Hour conversion WITH Conditional Formatting - Yikes!

    Greetings! I'll try and make this short and sweet! I need to conditional format a cell if number of total hours worked(Decimal) does NOT equal the total TIME worked (h:mm) ...

    We have a time sheet where we fill in both Start and Stop TIME for the day and than a section to add number, in DECIMAL, hours worked on a project. At the bottom are the totals for the projects in DECIMAL and the total work hours based on start and stop TIMES

    Start Work: 08:00 (8am)
    Stop Work: 17:30 (5pm)
    ---------------------
    Project 1: 3.5 (hours - decimal)
    Project 2: 4 (hours - decimal)
    Project 3: 2 (hours - decimal)
    ---------------------
    Time Working: 9:30 HOURS (Formula: 17:30-08:00)
    Total Project Time: 9.5 DECIMAL
    ---------------------

    I need to compare the Project time with Working Time and highlight the WORKING TIME cells if they are not equal.

    I cant change the formatting of the fields so I need to convert the numbers. What I did was this in a blank cell to verify it worked (where D29 is the DECIMAL number 9.5)
    =TEXT(D29/24,"h:mm") ==> This worked; the cell value was shown as 9:30 (from 9.5)

    I thought I had it solved so I setup conditional formatting as follows on the TIME WORKING cell:
    Cell Value not equal to =TEXT(D29/24,"h:mm") --> Format cell with RED FILL

    The way I read that is it should turn the cell RED only if the 9:30 did value did not equal the calculated and converted 9:30. Sadly the cell stays red no mater what I do!

    I have beaten my head against wall here - any ideas???

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Decimal to Hour conversion WITH Conditional Formatting - Yikes!

    Hi and welcome to the board

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Decimal to Hour conversion WITH Conditional Formatting - Yikes!

    Given that your already found a way to convert a decimal to hours; shouldn't your conditional formatting formula should state something like:
    =A1<>A2
    Cell Fill: Red if True???
    Ron
    Knowledge is knowing that a tomato and pepper are fruits. Wisdom is knowing whether to put these in a fruit salad

    Kindly

    [1] Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks
    [2] Mark your post [SOLVED] if it has been answered satisfactorily by editing your original post in advanced mode.
    [3] Thank (using the little scale) those that provided useful help; its nice and its very well appreciated

+ 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