MOD Function

Stubby

Board Regular
Joined
Mar 5, 2002
Messages
188
Hi fellow excel users!

I have a data list that has a column (called record) of sequential numbers. I needed to filter the list so that I see all the records whose record number was divisible by 5. A colleague suggested the following formula in the criteria row of an advanced filter would work:

=MOD(A7,5)=0

This does work, however I don't know why!! I understand that the MOD function takes a value and divides by the divisor (in this instance 5) and leaves a remainder but I'm at a loss as to what the =0 bit does.

Many thanks in advance for any help!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Many thanks VoG - thats got to be the quickest answer I have ever had using this site!
 
Upvote 0
Hi fellow excel users!

I have a data list that has a column (called record) of sequential numbers. I needed to filter the list so that I see all the records whose record number was divisible by 5. A colleague suggested the following formula in the criteria row of an advanced filter would work:

=MOD(A7,5)=0

This does work, however I don't know why!! I understand that the MOD function takes a value and divides by the divisor (in this instance 5) and leaves a remainder but I'm at a loss as to what the =0 bit does.

Since the MOD function returns the remainder after dividing the first argument by the second argument, that formula is testing if the remainder is 0... if it is, that must mean the second argument divided the first argument exactly (there was no remainder).
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,304
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