Back to Forms in Excel VBA archive index

Back to archive home

Hi,

I need to determine whether a PARTICULAR day is ODD or EVEN. In cell A1 I have =DAY(TODAY()) which generates the number for that day. From there I need to point a formula to they cell to determine Odd or Even. I have considered a series of IF formula's, but am troubled by the fact that there is limitation of 7 IF statements in one formula.

I simply want the formula to equate to either ODD or EVEN.

Does anybody know of a better solution. Any help much appreciated.

Regards

David

Check out our Excel Resources | ||||

David --

It's:

=IF(ISEVEN(DAY(TODAY())),"EVEN","ODD") if you have ISEVEN available.

Otherwise, use:

=IF(MOD(DAY(TODAY()),2)=0,"EVEN","ODD")

Also nice & useful:

=ISEVEN(DAY(TODAY()))+0

=(MOD(DAY(TODAY()),2)=0)+0

where a result of 1 must be treated as EVEN and 0 as ODD (You may reverse it if you like).

Aladin

=======

Thanks for that, works well. I don't think ISEVEN is available in Excel: David --

> Thanks for that, works well.

You're welcome.

> I don't think ISEVEN is available in Excel

But it is (Anyway in Excel 2000). What follows is from the Help file of Office 2000 on the Mac:

----------------------------------------------

ISEVEN

See Also

Returns TRUE if number is even, or FALSE if number is odd.

If this function is not available, run the Value Pack Installer to install the Analysis ToolPak. After you install the Analysis ToolPak, you must enable it by using the Add-Ins command on the Tools menu.

How?

Syntax

ISEVEN(number)

Number is the value to test. If number is not an integer, it is truncated.

Remarks

If number is nonnumeric, ISEVEN returns the #VALUE! error value.

Examples

ISEVEN(-1) equals FALSE

ISEVEN(2.5) equals TRUE

ISEVEN(5) equals FALSE

----------------------------------------------

This archive is from the original message board at www.MrExcel.com.

All contents © 1998-2004 MrExcel.com.

Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.

Microsoft Excel is a registered trademark of the Microsoft Corporation.

MrExcel is a registered trademark of Tickling Keys, Inc.

All contents © 1998-2004 MrExcel.com.

Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.

Microsoft Excel is a registered trademark of the Microsoft Corporation.

MrExcel is a registered trademark of Tickling Keys, Inc.