command for determing the remainder?

bk

Active Member
Joined
Jun 2, 2002
Messages
387
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.
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
 
Upvote 0
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!
 
Upvote 0

Forum statistics

Threads
1,222,313
Messages
6,165,285
Members
451,949
Latest member
bovacik

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