• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

CF with ISEVEN() possible?

Hello Everyone,

I am currently using a CF trick that I have learned here on Chandoo's site, which is =MOD(ROW(A2);2)=0

It's a great trick, but curious like I am, I wondered If I could do the same with the ISEVEN and ISODD Functions in Excel.

Can someone also explain, how these two functions are efficiently used?

Thank you for your Inside.

Have a nice Weekend.
 
Hello Everyone,

I am currently using a CF trick that I have learned here on Chandoo's site, which is =MOD(ROW(A2);2)=0

It's a great trick, but curious like I am, I wondered If I could do the same with the ISEVEN and ISODD Functions in Excel.

Can someone also explain, how these two functions are efficiently used?

Thank you for your Inside.

Have a nice Weekend.
Hi,

I assume this nice trick is striping rows using CF. Yes you can use ISODD/Even like this

=ISODD(ROW())

=ISEVEN(ROW())
 
Hi Mahir ,

To add to what Mike has posted , the division by 2 when it leaves no remainder ( MOD( number,2 ) = 0 ) is how you test for a number being even ; if there is a remainder when a number is divided by 2 , the number is odd ; thus in this case , ISEVEN and ISODD will do exactly the same as the method which uses MOD.

However , the method using MOD is a general technique , which can be used to stripe every third , fourth , fifth ,... row , since all you have to do is replace the 2 in the formula by 3 , 4 , 5 ,... ; these are situations in which you cannot use ISEVEN or ISODD.

Narayan
 
@Mike H.: Thank you. I tried it and it works nice. Especially if you want to have a 2 Color zebra scheme.

@NARAYANK991: Thank you. So you mean, =Mod(Row(??,2)=0 is checking for even numbers. If it would be an odd number the formula would be =Mod(row(??,2)=1 . Is that right, Sir?

Your Explanation has helped me a lot and it is very useful to understand that I can change the formatting of let's every third or fourth row and so on.
 
Hi Mahir ,

You are right ; =MOD( number , 2 ) = 1 is the same as ISODD( number ).

In your case , the formula =MOD( ROW() , 2 ) = 1 would be the same as =ISODD( ROW() )

Narayan
 
And the best part is that in the expression =MOD( number , 2 ) = 1 the "=1" or "=0" part is redundant.
All you need is =MOD( number , 2 )
 
Back
Top