+ Reply to Thread
Results 1 to 3 of 3

when IF formula is false, value isn't right

Hybrid View

readingmommy when IF formula is false,... 02-15-2012, 10:26 AM
Domski Re: when IF formula is false,... 02-15-2012, 10:39 AM
readingmommy Re: when IF formula is false,... 02-15-2012, 11:06 AM
  1. #1
    Registered User
    Join Date
    02-14-2012
    Location
    South Bend, IN
    MS-Off Ver
    Excel 2010
    Posts
    5

    when IF formula is false, value isn't right

    I've entered this formula in cell b4, =IF(a4>TIMEVALUE("40:00:00"), a4-TIMEVALUE("40:00:00"), 0) to pull only the overtime hours out of the total hours worked in a week (44:34) from cell a4. Now my question is, if the total hours worked in cell a4 is LESS than 40:00, this formula should put a "0" in the cell b4, right? Because I tested it by putting in 32:55 in cell a4 and got back a value of 16:55. Keep in mind these are formatted as [h]:mm.
    Last edited by readingmommy; 02-15-2012 at 10:32 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: when IF formula is false, value isn't right

    If you specify more than 24 hours the TIMEVALUE (and TIME) functions only return the remainder part once divided by 24 so 40 hours will only return 16 hours.

    Try: =IF(A4>(1/24)*40, A4-(1/24)*40, 0)

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    02-14-2012
    Location
    South Bend, IN
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: when IF formula is false, value isn't right

    Thank you! That work marvelously!!

+ 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