Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default IF formula & formatting

Dear Friends,

I'm stuck with this formula.. can you please help me?

here is the worksheet:

A1 = 7:00
A2 = 18:00

B1 = IN
B2 = OUT
B3 = MORNING OVER TIME
B4 = AFTERNOON OVERTIME
B5 = TOTAL OVERTIME

what I've done:

B3 = $A$1-B1
B4 = $A$2-B2
B5 = B3+B4

However, for the B3 formula, it keeps showing "######" as the result (for
negative result), therefore, I cannot find the total overtime correctly.

can you help me please?

thank you in advanced.

Rh33a
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default IF formula & formatting

Excel will calculate negative times, it just won't display them. So your
formulas will work regardless. I expect that your problem is you need to
check for start times after 7am, and end times before 6pm. Something like:

b3 =max(0,$a$1-b1)
b4 =max(0,b2-$a$2)

Remember to format these results as Time.

Regards,
Fred

"rh33a" wrote in message
...
Dear Friends,

I'm stuck with this formula.. can you please help me?

here is the worksheet:

A1 = 7:00
A2 = 18:00

B1 = IN
B2 = OUT
B3 = MORNING OVER TIME
B4 = AFTERNOON OVERTIME
B5 = TOTAL OVERTIME

what I've done:

B3 = $A$1-B1
B4 = $A$2-B2
B5 = B3+B4

However, for the B3 formula, it keeps showing "######" as the result (for
negative result), therefore, I cannot find the total overtime correctly.

can you help me please?

thank you in advanced.

Rh33a


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default IF formula & formatting

Thank you, Fred. It solved my problem..
but in the process, i found another problem:

our regulation is, if the overtime is less than an hour, won't be calculated
as overtime. for example:

A1 = 7:00
A2 = 18:00
A3 = 1:00

B1 = 6:45 (IN )
B2 = 18.30 (OUT)
B3 = 00:15 (MORNING OVER TIME)
B4 = 00:30 (AFTERNOON OVERTIME)
B5 = 00:45 (TOTAL OVERTIME) -- I want the result to be 0

this is the formula i've put:
=IF(b3<$a$3,0+b4,IF(b4<$a$3,b3+0,b3+b4))

So far, it works when 1 of the b3 and b4 more than 1 hour.. but when both
are less than 1 hour, it doesn't work.

Can you please help me??

Thank you..

I really appreciate your kind help. :)

Warmest regards,

rh33a



"Fred Smith" wrote:

Excel will calculate negative times, it just won't display them. So your
formulas will work regardless. I expect that your problem is you need to
check for start times after 7am, and end times before 6pm. Something like:

b3 =max(0,$a$1-b1)
b4 =max(0,b2-$a$2)

Remember to format these results as Time.

Regards,
Fred

"rh33a" wrote in message
...
Dear Friends,

I'm stuck with this formula.. can you please help me?

here is the worksheet:

A1 = 7:00
A2 = 18:00

B1 = IN
B2 = OUT
B3 = MORNING OVER TIME
B4 = AFTERNOON OVERTIME
B5 = TOTAL OVERTIME

what I've done:

B3 = $A$1-B1
B4 = $A$2-B2
B5 = B3+B4

However, for the B3 formula, it keeps showing "######" as the result (for
negative result), therefore, I cannot find the total overtime correctly.

can you help me please?

thank you in advanced.

Rh33a



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default IF formula & formatting

Try:

=if(b3+b4<$a$3,0,b3+b4)

Regards,
Fred

"rh33a" wrote in message
...
Thank you, Fred. It solved my problem..
but in the process, i found another problem:

our regulation is, if the overtime is less than an hour, won't be
calculated
as overtime. for example:

A1 = 7:00
A2 = 18:00
A3 = 1:00

B1 = 6:45 (IN )
B2 = 18.30 (OUT)
B3 = 00:15 (MORNING OVER TIME)
B4 = 00:30 (AFTERNOON OVERTIME)
B5 = 00:45 (TOTAL OVERTIME) -- I want the result to be 0

this is the formula i've put:
=IF(b3<$a$3,0+b4,IF(b4<$a$3,b3+0,b3+b4))

So far, it works when 1 of the b3 and b4 more than 1 hour.. but when both
are less than 1 hour, it doesn't work.

Can you please help me??

Thank you..

I really appreciate your kind help. :)

Warmest regards,

rh33a



"Fred Smith" wrote:

Excel will calculate negative times, it just won't display them. So your
formulas will work regardless. I expect that your problem is you need to
check for start times after 7am, and end times before 6pm. Something
like:

b3 =max(0,$a$1-b1)
b4 =max(0,b2-$a$2)

Remember to format these results as Time.

Regards,
Fred

"rh33a" wrote in message
...
Dear Friends,

I'm stuck with this formula.. can you please help me?

here is the worksheet:

A1 = 7:00
A2 = 18:00

B1 = IN
B2 = OUT
B3 = MORNING OVER TIME
B4 = AFTERNOON OVERTIME
B5 = TOTAL OVERTIME

what I've done:

B3 = $A$1-B1
B4 = $A$2-B2
B5 = B3+B4

However, for the B3 formula, it keeps showing "######" as the result
(for
negative result), therefore, I cannot find the total overtime
correctly.

can you help me please?

thank you in advanced.

Rh33a




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting in a formula Pat Canton Excel Discussion (Misc queries) 3 December 17th 08 04:36 AM
Formatting Formula Rodney Excel Discussion (Misc queries) 4 July 19th 08 10:05 PM
Formula Formatting Cosmo[_2_] Excel Discussion (Misc queries) 4 March 19th 07 10:19 PM
Formatting Within a Formula Rob Excel Discussion (Misc queries) 4 February 22nd 07 05:17 PM
Formatting in the formula bar Beccy Excel Discussion (Misc queries) 2 December 22nd 04 02:41 PM


All times are GMT +1. The time now is 04:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"