4 Replies Latest reply on May 13, 2013 6:58 PM by Brad Sheridan

# Check for even numbers

Hi All - newbie here, so please forgive what might be a really silly question.  How can i filter my sheet based on a measure where that measure is an even number?  For instance, Expense Amount might be 1,000 for the first transaction and 1,001 for the second.  I want only the first transaction to be returned.

• ###### 1. Re: Check for even numbers

You can use a formula like this to look for even numbers: [Row ID]%2 = 0

In the attached workbook, I used this in the filter on row ID.

• ###### 2. Re: Check for even numbers

Thanks Mark.  At first glance, it looks as if you're looking for even row NUMBERS...I'm looking to return only rows that have an even Fact amount...in my example above...Expense Amount.  Doesn't matter what row number is returned, so long as it's even.  That means it could end with 0, 2, 4, 6, or 8 or simply is evenly divisible by 2.

is this possible with the formula you provided?  What does the "%2" after the field name do?

thanks

• ###### 3. Re: Check for even numbers

I just used row ID as an example. The attached workbook returns only categories with an even sales number (rounded).

"%" is a mathmatic operator that means modulus. It calculates a remainder. If the remainder calculated by "% 2" is 0, then the statement returns true and thus it is an even number.

• ###### 4. Re: Check for even numbers

Thanks Mark for switching your sample to Sales...i thought it would work the same.  This worked great for me.  thanks again.