+ Reply to Thread
Results 1 to 3 of 3

If contains - nested ifs - shift workings

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    Manchester, England
    MS-Off Ver
    O365
    Posts
    23

    If contains - nested ifs - shift workings

    Hi

    I was wondering if anybody could help with this formula.

    Basically if a cell contains part of a word I want it to then work out how many hours the person has worked minus the breaks.

    The data headings are:
    A5: Emp Type
    B5: Shift Name
    C5: Start
    D5: Break Start
    E5: Break End
    F5: Finish
    G5: Total no Hrs

    The example data in the cells are:
    A6: Part Time
    B6:
    C6: 07:00
    D6: 12:00
    E6: 12:30
    F6: 15:00
    G6: This is where my formula is


    I have partially written a formula but i cant seem to get it to work. If I break it down the formulas seem to work but then they dont when i nest them.

    Here is the formula
    =IF(ISNUMBER(SEARCH("Part",A6)), IF((F6<C6,F6+1,F6)-C6), "error")

    Please can someone help.
    Thanks

  2. #2
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: If contains - nested ifs - shift workings

    This should work, i think you have your parentheses in the wrong place for your second if function.

    =IF(ISNUMBER(SEARCH("Part",A6)),IF(F6<C6,F6+1,F6)-C6,"Error")

  3. #3
    Registered User
    Join Date
    05-09-2012
    Location
    Manchester, England
    MS-Off Ver
    O365
    Posts
    23

    Re: If contains - nested ifs - shift workings

    Thanks very much for the reply. It works now, can't believe it was something so simple.

    I have added an extra bit in the minus the breaks and it works great

    =IF(ISNUMBER(SEARCH("Part",A6)),IF(F6<C6,F6+1,F6)-C6-(E6-D6),"error")

    Thanks again for your help amotto11

+ 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