Results 1 to 7 of 7

Thread: formula problem

  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Harrisburg, Pennsylvania, USA
    Posts
    168
    Thanks
    1
    Thanked 0 Times in 0 Posts

    formula problem

    Hello All,

    i am creating a sheet for making a schedule and I want the result to be 0 if we are putting anything into the cells other than hours. i have attached a sample week schedule to show my problem.

    Thank you in advance for all who will take the time to help,
    Attached Files Attached Files

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    How about ensuring that both E2 and E3 are numbers:
    =IF(COUNT(E2:E3)=2,(E3-E2)*24,0)

    Steve

  3. #3
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Harrisburg, Pennsylvania, USA
    Posts
    168
    Thanks
    1
    Thanked 0 Times in 0 Posts
    How about ensuring that both E2 and E3 are numbers:
    =IF(COUNT(E2:E3)=2,(E3-E2)*24,0)

    Steve ,,,, Thanks for the above, however it results in creating a "0" on any input ..even the correct time listings. I need the formula to show "0" only if regular hour numbers are not put in cells. Thanks again for the effort.

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    The formula works for me in the example worksheet you attached....

    It will show zero if either of the values are not numbers....

    Steve

  5. #5
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Harrisburg, Pennsylvania, USA
    Posts
    168
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi Steve,


    I am re-attaching the test with your formula in place .. What am I missing???
    thanks
    cvbs
    Attached Files Attached Files

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    The formula:
    =IF(COUNT(G2:G3)=2,(G3-G2)*24,0)

    Goes in G4, not H4 and then copied to the others. The way you have it you check the cells to the left...

    Steve

  7. #7
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Harrisburg, Pennsylvania, USA
    Posts
    168
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hey Steve....

    Wow ... I do not know how i missed that .... I will blame it on lack of sleep.
    Thanks for the help ... you are right ... it works fine.
    Have a great day

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •