Need the right Formula

ggwynn

New Member
Joined
Mar 17, 2011
Messages
10
i'm having troubles with the if function of excel and already spent many hours but still no positive result,i want to make a record of my overtimes daily,what is the right formula in excel,the conditions are as follow:

Monday to Friday(total work hours-8= overtime)
Saturday(total work hours-4= Overtime)
Sunday(total work hours=overtime)
please help.thank you
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
i'm having troubles with the if function of excel and already spent many hours but still no positive result,i want to make a record of my overtimes daily,what is the right formula in excel,the conditions are as follow:

Monday to Friday(total work hours-8= overtime)
Saturday(total work hours-4= Overtime)
Sunday(total work hours=overtime)
please help.thank you

What is the minus doing?not entirely clear what your layout is or what your trying to show. is it anything over the stated daily 8 hours and 4 hours for Sat?
 
Upvote 0
Welcome to the forums!

Need something like this?

Excel 2003<TABLE style="BORDER-RIGHT: #a6aab6 1px solid; BORDER-TOP: #a6aab6 1px solid; BORDER-LEFT: #a6aab6 1px solid; BORDER-BOTTOM: #a6aab6 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #ffffff" cellPadding=2 rules=all><COLGROUP><COL style="BACKGROUND-COLOR: #e0e0f0" width=25><COL><COL><COL></COLGROUP><THEAD><TR style="COLOR: #161120; BACKGROUND-COLOR: #e0e0f0; TEXT-ALIGN: center"><TH></TH><TH>A</TH><TH>B</TH><TH>C</TH></TR></THEAD><TBODY><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">1</TD><TD>Date</TD><TD>Hours Worked</TD><TD>Hours Overtime</TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: right">Sun, 03/13/11</TD><TD style="TEXT-ALIGN: right">3</TD><TD style="TEXT-ALIGN: right">3</TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: right">Mon, 03/14/11</TD><TD style="TEXT-ALIGN: right">7.5</TD><TD style="TEXT-ALIGN: right">0</TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: right">Tue, 03/15/11</TD><TD style="TEXT-ALIGN: right">8</TD><TD style="TEXT-ALIGN: right">0</TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: right">Wed, 03/16/11</TD><TD style="TEXT-ALIGN: right">10</TD><TD style="TEXT-ALIGN: right">2</TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">6</TD><TD style="TEXT-ALIGN: right">Thu, 03/17/11</TD><TD style="TEXT-ALIGN: right">9</TD><TD style="TEXT-ALIGN: right">1</TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">7</TD><TD style="TEXT-ALIGN: right">Fri, 03/18/11</TD><TD style="TEXT-ALIGN: right">8</TD><TD style="TEXT-ALIGN: right">0</TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">8</TD><TD style="BORDER-BOTTOM: black 1px solid; TEXT-ALIGN: right">Sat, 03/19/11</TD><TD style="BORDER-BOTTOM: black 1px solid; TEXT-ALIGN: right">5</TD><TD style="BORDER-BOTTOM: black 1px solid; TEXT-ALIGN: right">1</TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">9</TD><TD style="BORDER-TOP: black 1px solid">Total</TD><TD style="BORDER-TOP: black 1px solid; TEXT-ALIGN: right">50.5</TD><TD style="BORDER-TOP: black 1px solid; TEXT-ALIGN: right">7</TD></TR></TBODY></TABLE><TABLE style="BORDER-RIGHT: #a6aab6 1px solid; BORDER-TOP: #a6aab6 1px solid; BORDER-LEFT: #a6aab6 1px solid; BORDER-BOTTOM: #a6aab6 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #ffffff" cellPadding=2 rules=all><THEAD><TR style="COLOR: #161120; BACKGROUND-COLOR: #e0e0f0; TEXT-ALIGN: center"><TH>Sheet3</TH></TR></TD></THEAD><TBODY></TBODY></TABLE>

<TABLE style="BORDER-RIGHT: black 2px solid; PADDING-RIGHT: 0.4em; BORDER-TOP: black 2px solid; PADDING-LEFT: 0.4em; PADDING-BOTTOM: 0.4em; BORDER-LEFT: black 2px solid; PADDING-TOP: 0.4em; BORDER-BOTTOM: black 2px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #ffffff" cellPadding=2 rules=all width="85%"><TBODY><TR><TD style="PADDING-RIGHT: 6px; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; PADDING-TOP: 6px">Worksheet Formulas<TABLE style="BORDER-RIGHT: #a6aab6 1px solid; BORDER-TOP: #a6aab6 1px solid; BORDER-LEFT: #a6aab6 1px solid; BORDER-BOTTOM: #a6aab6 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: center" cellPadding=2 rules=all width="100%"><THEAD><TR style="COLOR: #161120; BACKGROUND-COLOR: #e0e0f0"><TH width=10>Cell</TH><TH style="PADDING-LEFT: 5px; TEXT-ALIGN: left">Formula</TH></TR></THEAD><TBODY><TR><TH style="COLOR: #161120; BACKGROUND-COLOR: #e0e0f0" width=10>C2</TH><TD style="TEXT-ALIGN: left">=MAX(B2-LOOKUP(WEEKDAY(A2),{1,2,3,4,5,6,7},{0,8,8,8,8,8,4}),0)</TD></TR><TR><TH style="COLOR: #161120; BACKGROUND-COLOR: #e0e0f0" width=10>B9</TH><TD style="TEXT-ALIGN: left">=SUM(B2:B8)</TD></TR><TR><TH style="COLOR: #161120; BACKGROUND-COLOR: #e0e0f0" width=10>C9</TH><TD style="TEXT-ALIGN: left">=SUM(C2:C8)</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
 
Upvote 0
not really like that,i have a format but i can't post it..hmmm i wonder why..thanks for the welcome
 
Upvote 0
not really like that,i have a format but i can't post it..hmmm i wonder why..thanks for the welcome

If you can describe the layout of your data, we might be able to tailor a formula to your needs.
 
Upvote 0
well...
1st column is the date, i.e 1-31
2nd column is the day, i.e Sunday-Saturday,
3rd column to 26th column is the time, i.e 0000h-2300h military time
27th column is the total work hours
28th column is the Over time hours
i'll have to tally every hour,,what i really need is the "if formula"..i guess this will be easier if i can provide a picture..
 
Upvote 0
photo.php

hey,,here it is,
the value of "/" and "\" is 0.5
the value of "X" is 1

i want to make the formula in the "Total O/T" column
this is my formula for Monday to Friday =IF(AA17>0,ABS(AA17-8),0)
but i still have Saturdays and Sundays
during saturday i have to work 4 hours and the excess hours will be overtime, sundays are overtime

sorry for bothering you guys
 
Upvote 0
photo.php

hey,,here it is,
the value of "/" and "\" is 0.5
the value of "X" is 1

i want to make the formula in the "Total O/T" column
this is my formula for Monday to Friday =IF(AA17>0,ABS(AA17-8),0)
but i still have Saturdays and Sundays
during saturday i have to work 4 hours and the excess hours will be overtime, sundays are overtime

sorry for bothering you guys

Try uploading the picture to a free image sharing site like photobucket or imageshack.

And don't worry about "bothering" us, we're all volunteers here. ;)
 
Upvote 0
Maybe this will work for you

In the first column, enter your dates as regional format i.e. for UK dd/mm/yyyy this way, excel will recognise them as actual dates.

In AA17 =COUNTIF(C17:Z17,"X")+(COUNTIF(C17:Z17,"\")+COUNTIF(C17:Z17,"/"))/2
In AB17 =MAX(0,AA17-LOOKUP(WEEKDAY(A17,3),{0,5,6},{8,4,0}))

Hope this helps.
 
Upvote 0
Excel Workbook
ABCDEF
2DateDayStartEndHoursOT Hours
301/02/2011Tue18:0003:0009:0001:00
402/02/2011Wed18:0003:0009:0001:00
503/02/2011Thu18:0002:0008:0000:00
604/02/2011Fri18:0002:0008:0000:00
705/02/2011Sat14:0019:0005:0001:00
806/02/2011Sun10:0015:0005:0005:00
907/02/2011Mon18:0005:0011:0003:00
1008/02/2011Tue18:0003:0009:0001:00
1109/02/2011Wed18:0002:0008:0000:00
1210/02/2011Thu18:0002:0008:0000:00
1311/02/2011Fri14:0019:0005:0000:00
1412/02/2011Sat10:0015:0005:0001:00
1513/02/2011Sun18:0002:0008:0008:00
1614/02/2011Mon18:0003:0009:0001:00
1715/02/2011Tue18:0002:0008:0000:00
1816/02/2011Wed18:0002:0008:0000:00
19Total O/T22:00
Sheet4
Excel 2010
Cell Formulas
RangeFormula
B3=A3
E3=MOD(D3-C3,1)
F3=IF(WEEKDAY(A3,2)=6,MAX(TIMEVALUE("4:00"),E3)-TIMEVALUE("4:00"),IF(WEEKDAY(A3,2)=7,E3,MAX(TIMEVALUE("8:00"),E3)-TIMEVALUE("8:00")))
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top