+ Reply to Thread
Results 1 to 21 of 21

Problem resolving a MOD formula

  1. #1
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Problem resolving a MOD formula

    Attached is a file to show what is happening

    Currently I have a Booked time placed in column A followed by a start A and finish A time, then start B finish B time. The 2 times are added together to produce a Total Time loading.
    The formulas in column L, at present only take into account Start & Finish A making the result incorrect againt Column A.
    Can someone help with the correct formulas to be placed in Column L.

    As an example the cell L3 should be N as the completed time in Cell E3 is greater than the booked
    Attached Files Attached Files
    Last edited by ukphoenix; 09-13-2013 at 07:47 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Problem resolving a MOD formula

    Remove MOD, it's not needed as the times don't have a date part.
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Problem resolving a MOD formula

    Hi,

    I've had a look at your workbook and I don't understand what is happening.

    Can you please explain a bit clearer what it is that you are trying to achieve?

    You said that E3 (= 20:01) is greater than the booked (A3 = 17:00) and hence L3 should say "N", but E2 (= 19:00) is greater than the booked too (A2 = 14:00), so why shouldn't L2 be "N", and similarly why shouldn't L4 also be "N"???

  4. #4
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    removing MOD function returns an error. I believe the MOD was used as when times hit 00:00 it through an error and so had to work as 24hr. I may well be wrong as am a novice in formulas and the original MOD formula was supplied by another forum user. It worked fine when there was only Start & Finish A but now we have breaks in loads the second set of timings need to be accounted for which currently they do not.
    Just need to know where to place these cells within the current formula.

  5. #5
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    Quote Originally Posted by ajryan88 View Post
    Hi,

    I've had a look at your workbook and I don't understand what is happening.

    Can you please explain a bit clearer what it is that you are trying to achieve?

    You said that E3 (= 20:01) is greater than the booked (A3 = 17:00) and hence L3 should say "N", but E2 (= 19:00) is greater than the booked too (A2 = 14:00), so why shouldn't L2 be "N", and similarly why shouldn't L4 also be "N"???
    Sorry my oversite. You are correct L2 should also be N (my bad) but L4 should be Y as 18:50 is before 19:00. Formula needs to reflect if load is late compared to booked time

  6. #6
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    Trying to break this down a little more. ????
    Column A = Booked
    Finish B (Column E)= Completed Time
    Column L needs to reflect if before or after 'Booked' and return a Y or N

    Hope im making sense
    Last edited by ukphoenix; 09-13-2013 at 06:05 PM.

  7. #7
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Problem resolving a MOD formula

    Hi,

    Try this formula then:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Is it that simple? Or does start/finish A need to be considered too?

  8. #8
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    We are a 24hr operation aswell so when a load is booked for 01:00 and is completed @23:00 (2 hours early) this should reflect as a Y (on time). I think this is why a MOD formula was used initially

  9. #9
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    Quote Originally Posted by ajryan88 View Post
    Hi,

    Try this formula then:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Is it that simple? Or does start/finish A need to be considered too?
    As mentioned would this still read true for the cross midnight loads

  10. #10
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Problem resolving a MOD formula

    Hi,

    Have you considered implementing dates and times instead of just times??

    My formula above will work across midnight loads IF dates are entered as well. In fact, it will make your life a lot easier to insert the dates as well, because without the dates the formula that would be required would have to take care of a lot of conditions that could easily be avoided if a date was present.

    Hope this helps

  11. #11
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    NO sorry a date cannot be incorperated as the shift works 18:00 to 06:00 and will liast on sheets as only 1 date.

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Problem resolving a MOD formula

    Did you try just removing MOD?

    =IF(C2-B2>A2-B2,"N","Y")

  13. #13
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    Quote Originally Posted by Norie View Post
    Did you try just removing MOD?

    =IF(C2-B2>A2-B2,"N","Y")
    Yes but this will not work wth cross midnight loads. As an 01:00 load completed @23:00 will show as N (late) where in fact it was 2 hours early. Unless im missing something ???

  14. #14
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Problem resolving a MOD formula

    Change the order of the calculations based on which time is greatest.

  15. #15
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Problem resolving a MOD formula

    Hi,

    Try this then:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hope this works

  16. #16
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    By changing the order of calculation will not work on all times.
    Your formula works for same date only but we cross midnight, and the booked times wont change. But they may be different booked times on different days which is why i need 1 formula to work across the midnight area.
    at present your formula works with the example I gave, but if u changed Cell A4 to 01:00 and completed time to 23:00 it returns as a N (late)

  17. #17
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    Quote Originally Posted by ajryan88 View Post
    Hi,

    Try this then:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hope this works
    That looks like the one that works. will trial it and give feed back. thanx guys

  18. #18
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Problem resolving a MOD formula

    No problems!

    If this solves your issue, please be sure to let the forum know by marking this thread as solved, and please click on the * next to any post(s) that were helpful to you.

    Thanks

  19. #19
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    Ive crossed another dilemma with this formula.

    If the load is completed in the first section (cells B2 - C2) then the E cell remains blank and the formula doesnt pick up the finish time. Any suggestions?

  20. #20
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Problem resolving a MOD formula

    Try this slightly modified formula then:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  21. #21
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    MS365 V2308
    Posts
    279

    Re: Problem resolving a MOD formula

    That seems to be the result i was looking for. Thanx aj

+ 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. Replies: 3
    Last Post: 08-02-2013, 02:16 PM
  2. [SOLVED] resolving a #DIV/0! error
    By okcsteve in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-29-2013, 11:14 AM
  3. Need help resolving worksheet naming problem
    By Julez80s in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2013, 03:51 PM
  4. Problem resolving formula with IF function
    By bazhsw in forum Excel General
    Replies: 2
    Last Post: 10-14-2011, 10:27 AM
  5. resolving #VALUE!
    By cwnan64 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-28-2009, 01:11 PM

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