+ Reply to Thread
Results 1 to 3 of 3

Multiple IF and MOD statements unsure about parentheses

  1. #1
    Registered User
    Join Date
    12-10-2008
    Location
    Australia
    Posts
    1

    Question Multiple IF and MOD statements unsure about parentheses

    Hi there,

    I have been working on this code for two days now and i just cant quite crack it.

    Basically what it does is calculate how many work days and hours a job will take.

    Seeing as a days production is 9 hours i want it to add 0.6 to any remainder that is between 0.4 and 0.8 and add 1.2 to anything that has a remainder of 0.8 or above.

    It is also written to display nothing if there is no value in C4.

    Formula:

    =IF(C4>0,(IF((AND((MOD((I4/(J4*M4)),9))>0.4),((MOD((I4/(J4*M4)),9))<0.8))),(((I4/(J4*M4))/9)+0.6),(IF(((MOD(I4/(J4*M4)),9)>=0.8),(((I4/(J4*M4))/9)+1.2),((I4/(J4*M4))/9)))),””)

    Using:

    I4 = 1000
    J4 = 2
    M4 = 133

    Result should end up being 0.42 or 10 hours, however i want this to roll over to 1 days, 1 hours

    I think i've just stuffed up the brackets somewhere

    Any help greatly appreciated, or suggestions

    Thanks

    Cookie
    Last edited by cookieof89; 12-11-2008 at 02:41 AM. Reason: title

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284
    I don't get the logic, but this formula gets a return

    =IF(C4>0,IF(AND(MOD(I4/(J4*M4),9)>0.4,MOD(I4/(J4*M4),9)<0.8),(I4/(J4*M4)/9)+0.6,
    IF(MOD(I4/(J4*M4),9)>=0.8,(I4/(J4*M4)/9)+1.2,I4/(J4*M4)/9)),"")

  3. #3
    Forum Contributor
    Join Date
    02-19-2005
    Location
    Gurgaon,India
    MS-Off Ver
    2007,2010,2013
    Posts
    180
    Hi,


    =IF(C4>0,IF(I4/(J4*M4)>0.4,(I4/(J4*M4)/9)+LOOKUP(MOD(I4/(J4*M4),9),{0,0.4,0.8},{0,0.6,1.2}),I4/(J4*M4)),"")
    Last edited by Krishnakumar; 12-11-2008 at 05:57 AM.
    Kris

+ 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