MOD Function & hours between dates/ Excel 2010

olebuddy

New Member
Joined
Aug 16, 2011
Messages
1
Hello Folks!
This is my first time on the board. I found y'all from Microsoft online help when I was searching out an answer to a problem I am working on. I know my question will probably be very simple to all y'all as I am very much a rookie with Excel. Anyway, here it goes...I would appreciate if y'all wouldn't laugh at me! Ha!
Thanks for your help!

Two questions:
1) Please explain the MOD function to me.
I understand that the MOD function divides two numbers and brings back the remainder. What I don't understand is how you get the answer of "1" with "=MOD(5,2)."

2) I am trying to caculate hours between dates, excluding weekends.
Example:
Cell A1 = 4/5/2011 10:00
Cell B1 = 4/25/2011 13:30
 
Last edited:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
MOD basically performs the division as many times as it can where the divisor will go entirely into the number.

If we step through your example:

Does 2 go into 5? yes. So we take one of those 2's away which leaves three. Does 2 go into 3? yes, so we take that 2 away and we are left with 1, does 2 go into one? no, so there is our result.

If you had MOD(10,4), you'd get 2 because 4 goes into 10 two whole times, and that leaves two left.

As for your next question, the following formula should work for you:

=NETWORKDAYS(A1,A2)*24+(MOD(A2,1)-MOD(A1,1))*24
 
Last edited:
Upvote 0
Or with one less multiplier (time for me to go to bed!)

=(NETWORKDAYS(A1,A2)+MOD(A2,1)-MOD(A1,1))*24
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

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