Ask Experts Questions for FREE Help !
Ask
    Micio's Avatar
    Micio Posts: 10, Reputation: 1
    New Member
     
    #1

    Mar 28, 2009, 10:59 PM
    How to calculate total hours scheduled in excel spreadsheet
    Hi,
    I am trying to create a schedule for my employees and at the same time being able to calculate (or forcast for myself) the total hours that will be worked.

    e.g.

    A B C D E F G H I... P

    1 NAME MONDAY TUESDAY WEDNESDAY THURSDAY... TOTAL
    2 IN OUT IN OUT IN OUT IN OUT
    3 JOHNY 6AM 2PM 6AM 2PM 1PM 9PM OFF... =((C3-B3+(C3<B3))*24)+((E3-D3+(E3<D3))*24)+...

    It works perfectly, except, when I type in OFF the formula doesn't work... it shows #VALUE!

    Is there a way I can type OFF instead of the time and the formula will still calculate the total hours per week?

    Thank you
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #2

    Mar 28, 2009, 11:34 PM

    Add an IF(ISTEXT() check into each one of those segments to return a "0" value if text is found in either time cell.

    =(IF(OR(ISTEXT(C3),ISTEXT(B3)),0,(C3-B3+(C3<B3))*24))
    Micio's Avatar
    Micio Posts: 10, Reputation: 1
    New Member
     
    #3

    Mar 29, 2009, 12:30 PM
    THANK YOU JB, IT WORKED GREAT!

    I HAVE ONE MORE QUESTION:
    How can I create the following formula:
    IF B6 & B7 is text then 0, but if B6 is number then 1, and if both B6 & B7 are numbers then 2.

    Is that possible? Thank you
    KISS's Avatar
    KISS Posts: 12,510, Reputation: 839
    Uber Member
     
    #4

    Mar 29, 2009, 01:10 PM

    isnumber(expression) and and(x1,x2,. xn) is a function so you can create what you want.

    You could have also used in the previous question with if('OFF", 0, C2)

    would have given the value of 0 if off or C2 if not equal to 'off'.
    Micio's Avatar
    Micio Posts: 10, Reputation: 1
    New Member
     
    #5

    Mar 29, 2009, 04:04 PM
    It doesn't want to work for me.

    All I need is to come up with a formula that gives me the total number of employees per day.

    In B1 - C1, B2- C2, B3- C3, B4- C4... etc. I am entering either (text) they are off or on vacation or time to come in and out.

    How can I create a formula that will represents: if text or blank = 0
    =IF(OR(ISTEXT(B7),ISTEXT(B8)),0,. and then if there is number or time entered please add 1... in adition the ones "1" will need to be also added together for each employee.

    Thank you
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #6

    Mar 29, 2009, 05:03 PM

    I think you've overthought the problem. You don't need to test B6 and B7 for 0, you just need a TRUE/FALSE test on each cell for numerics. TRUE is the Excel equivalent of the number 1, so if you add TRUE+TRUE you get 2.

    I think this is all you need:

    =ISNUMBER(B6) + ISNUMBER(B7)

    But, if for some reason you think you need to do the "text" test, too, which I don't think you do, then use this instead:

    =IF(AND(ISTEXT(B6), ISTEXT(B7)), 0, ISNUMBER(B6) + ISNUMBER(B7))

    But in my tests, these formulas behave exactly the same, making the second one unnecessary.
    Micio's Avatar
    Micio Posts: 10, Reputation: 1
    New Member
     
    #7

    Mar 29, 2009, 05:15 PM
    THANK YOU JBeaucaire. IT WORKS GREAT!!!! YOU ARE THE BEST. :) THANK YOU
    kalpit_84's Avatar
    kalpit_84 Posts: 1, Reputation: 1
    New Member
     
    #8

    Feb 3, 2013, 02:22 PM
    Hello, JB

    I typed the formula you have given it to me and it work for single time box. (Single day)

    For multiple days I typed the following and gave me ans as "12:00 AM"

    =(IF(OR(ISTEXT(C5),ISTEXT(B5)),0,(C5-B5+(C5<B5))*24))+(IF(OR(ISTEXT(E5),ISTEXT(D5)),0,( E5-D5+(E5<D5))*24))

    Any idea what is wrong with this equation.
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #9

    Feb 4, 2013, 01:55 AM
    After first entering a formula in a cell that references other cells that have TIME values in them, Excel often changes the format of the formula cell to TIME as well.

    Select the cell, press CTRL-1 to open the formatting window, change the NUMBER format back to General, or whatever else you may want it to be.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

MS Excel spreadsheet changing numbers [ 4 Answers ]

I have a spreadsheet where I enter credit card numbers, 16 digits. One note, I have the field setup as a custom format, that displays in the custom format as ####-####-####-####. This way it automatically adds the 4 dashes. For some reason, it always changes the last digit to zero. For...

Displaying formulas in Excel Spreadsheet [ 1 Answers ]

Formula currently appears in the cell rather than formula result value. I want the result value to appear in the cell and the formula to appear only in the formula bar. How do I make this change? I am working in Excel 2003.

Excel Spreadsheet [ 1 Answers ]

I need a macro or something for a website that has a excel spreadsheet. My client has a excel spreadsheet out on a website. They have invoice # on the excel spreadsheet and want to be able to scan the invoice and have it linked to the invoice on the website so clients can see the scanned document....

Excel Spreadsheet [ 2 Answers ]

Does anyone know how I can get an Excel spreadsheet to open at start-up? Thanks!


View more questions Search