UNSOLVED

jaystevenson

updated

23 years ago

J

jaystevenson

1 Rookie

•

114 Posts

0

4418

November 21st, 2003 02:00

MS Excel question

I have a bunch of numbers in the first column of an Excel spreadsheet.  In the second column, I want to run a command that tells me if the numbers in the first column are divisble by 3.  To clarify, in the second column, I want it to say either "yes" or "no" depending on whether the number in the cell immediately to its right is divisible by 3. 

Anybody know how I would go about doing this?

Thanks a lot in advance. 

  • Denny Denham

    2 Intern

    •

    18798 Posts

    242

    0

    Posted November 21st, 2003 03:00

    jaystevenson,

    If the value to be tested is in cell Ax use the formula:

    =NOT(Ax/3<>(INT(Ax/3)))

    This will return FALSE if Ax is not divisible by 3 and TRUE if it is.

  • 242

    0

    Posted November 21st, 2003 13:00

    jaystevenson:

    To achieve the Yes/No answer, you may use the 'IF' function to test the value in the cell.  For example:

    =IF(MOD(A1,3)=0,"YES","NO")

    This equation reads: If the value in cell A1, when divided by 3, leaves a remainder of 0, then display "Yes", otherwise display "No".  I only use the 'MOD' function because it is shorter.  You may test for Denny's example as well.

  • Denny Denham

    2 Intern

    •

    18798 Posts

    242

    0

    Posted November 21st, 2003 15:00

    firstclermont,

    I like your function better. Mine was rooted in Fortran IV with a sprinkling of Quattro Pro.