# command for determing the remainder?

#### bk

##### Active Member
I need to be able to determine if a Year is an even number away from this year (2004,6,8,etc.) I figured I could subtract 2002 from the Year I get from the user and then divide, a zero remainder means I have an even year.

I don't know the syntax for getting the remainder and I assume that there is one to use in XL and/or VB.

Thanks.

### Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
=MOD(number,divisor) function

Have a look at "mod" in the VBA help. Would this do what you want?

On 2002-08-23 10:43, bk wrote:
I need to be able to determine if a Year is an even number away from this year (2004,6,8,etc.) I figured I could subtract 2002 from the Year I get from the user and then divide, a zero remainder means I have an even year.

I don't know the syntax for getting the remainder and I assume that there is one to use in XL and/or VB.

Thanks.

In the world of formulas it would be e.g.

=MOD(ABS(YEAR(A1)-B1),2)=0

where A1 houses a full-fledged date and B1 a value like 2004. With or without ABS...

Have also a look at the ISEVEN function...
This message was edited by Aladin Akyurek on 2002-08-23 11:03

Also...

=ISEVEN(2002-2004)

...which is supplied by the Analysis ToolPak add-in.

On 2002-08-23 10:59, Aladin Akyurek wrote:
On 2002-08-23 10:43, bk wrote:
I need to be able to determine if a Year is an even number away from this year (2004,6,8,etc.) I figured I could subtract 2002 from the Year I get from the user and then divide, a zero remainder means I have an even year.

I don't know the syntax for getting the remainder and I assume that there is one to use in XL and/or VB.

Thanks.

In the world of formulas it would be e.g.

=MOD(ABS(YEAR(A1)-B1),2)=0

where A1 houses a full-fledged date and B1 a value like 2004.

ABS() is unncessary. Negative numbers are even too!

I like ISODD better. How about

=ISODD(A1)=ISODD(B1)

Replies
5
Views
644
Replies
3
Views
469
Replies
3
Views
1K
Replies
0
Views
288
Replies
6
Views
257

1,196,497
Messages
6,015,553
Members
441,900
Latest member
Inaschemitex2023

### 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.

### Which adblocker are you using?

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

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