+ Reply to Thread
Results 1 to 9 of 9

Help with if function in excel

  1. #1
    Registered User
    Join Date
    07-29-2008
    Location
    united states
    Posts
    12

    Help with if function in excel

    Good Morning All,

    I would like the ST to indicate no more than 80 hours, and OT to indicate the total # of hours over 80. What am I doing wrong with my ST & OT formulas or the format of those two cells? Any assistance would be greatly appreciated. Attached is the worksheet that has me stumped.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-21-2006
    Location
    Ossett, West Yorkshire
    MS-Off Ver
    2003
    Posts
    150

    Smile

    Hi.
    I believe because the way the cells I8:I21 are formatted excel is reading the cell value of 12:00 hours as half of one day so when you sum the range I8:I21 instead of 108 hours it calculates it as 4.5 days so when you ask the question =If(I22<80,I22,80) it reads that it is less than 80 in fact it reads 4.5 the easy way round this is to alter formula in cell I24 to
    =IF(I22<3.333,I22,3.3334) 3.3334*24= 80hrs and in cellI25 formula is:
    =IF(I22<3.333,Round(I22-3.3334,0)0) which deliver the correct answers that I believe you were looking for.
    hope this helps
    regards Howard

  3. #3
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    It's all to do with time formatting. One solution, a little messy is

    ST
    Please Login or Register  to view this content.
    OT

    Please Login or Register  to view this content.
    Ed
    _____________________________
    Always learning, but never enough!
    _____________________________

  4. #4
    Registered User
    Join Date
    07-29-2008
    Location
    united states
    Posts
    12

    One more question

    Thanks for the formula suggestion. It worked just fine; however, I do have 1 additional ?. Would it be better to leave the formula as is and change the format of the cells where time is entered? What is the best format to use when time is involved? I believe the way I have it formatted requires the time to be entered in military format. Looking forward to your reply.

  5. #5
    Forum Contributor
    Join Date
    08-21-2006
    Location
    Ossett, West Yorkshire
    MS-Off Ver
    2003
    Posts
    150
    Hi,
    To use your original formulas then format the timesheet to number format as I have done on the attachment.


    As far as which avenue to go down I personally would use original time format with Ed's formula's. Ed describes them as messy, but they are not as messy as mine.
    Regards Howard
    Attached Files Attached Files

  6. #6
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Working with time can be difficult and produce results that appear non-sensical, as you found.

    If I get results that don't appear to make sense, I always go to TOOLs, Formula auditing > Evaluate to see what is happening.

    I think I would go with Howard and stick with the way you have started - once you understand what is going on, it ceases to be a problem.

  7. #7
    Registered User
    Join Date
    07-29-2008
    Location
    united states
    Posts
    12

    Protecting cell formatting that requires data entry

    Guys,

    Thanks for all of your assistance. I took Ed's suggestion and made the changes to the formulas. For whatever reason, the workers feel more comfortable seeing A.M. and P.M. I have one more question. If I want to protect the cell format but allow users to enter data in the cells I want to protect, what steps do I take to get this done?

    Many thanks,

    Ryan

  8. #8
    Forum Contributor
    Join Date
    08-21-2006
    Location
    Ossett, West Yorkshire
    MS-Off Ver
    2003
    Posts
    150

    Smile Protect format of cells

    Hi Ryan,
    to protect the time format of the input cells then select the range C8:H21
    then go to format>cells> then click on Protection tab and make sure that the cells are locked that is ticked.

    Then go to Tools>Protection>allow users to edit> click on new this registers the range if yiu want to enter a password do so. come out of this then Protect the worksheet in the normal way.

    The range with the weekly date if that is formatted should be protected this way as well. Other cells where user has input then they should be unlocked by selecting them going to format>cells>protection and removing the tick in the Locked box.
    hope I have explained this clearly for you
    regards Howard

  9. #9
    Registered User
    Join Date
    07-29-2008
    Location
    united states
    Posts
    12

    Lunch time taken that is < an hour

    I am trying to determine what's the easiest way for employees to enter < an hour for lunch. With the current format of [h]:mm, employees need to enter 00:30 for a 30 minute lunch. Is this the easiest way to enter fractions of an hour or is a better option available?


    Thanks,

    Ryan

+ 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. NORMDIST function in excel giving values greater than 1
    By excelwho in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-09-2013, 11:43 PM
  2. DIR function in excel, opening multiple files.
    By jw191 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2008, 07:30 AM
  3. How to use Standard Excel function in VBA
    By akabraha in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2007, 03:50 PM
  4. Excel Function
    By digital21st in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-27-2007, 07:33 AM
  5. Javascript function converting to Excel function
    By kamila in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-31-2007, 07:06 AM

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