+ Reply to Thread
Results 1 to 7 of 7

Divisible by 10 test

  1. #1
    Registered User
    Join Date
    05-17-2005
    Posts
    13

    Divisible by 10 test

    I would like to do one of two things.

    Test to see that 6 different cells are all divisible by 10.

    or

    Test to see if a certain cell is shaded grey and if so then shade a different cell if it is. I dont think this can be done in the conditinal formatting since as part of my test I am checking for a format condition.

  2. #2
    Registered User
    Join Date
    02-21-2005
    Posts
    56
    For a single answer:

    =if(and(right(cell1,1)=0,right(cell2,1)=0,right(cell3,1)=0,...,right(cell(6,1)=0),TRUE,FALSE)

    or to check each cell separately:

    =if(right(cell,1)=0,TRUE,FALSE)

    I'm sure is a more 'compact' way of doing this.

    Alastair

    p.s I don't think you can base a condition on a format

  3. #3
    Registered User
    Join Date
    05-17-2005
    Posts
    13
    Alastair,

    when I use

    =if(right(A1,1)=0,TRUE,FALSE)

    and place a multiple of 10 in A1 it doesnt return a true value. Might I be doing something wrong?

  4. #4
    Registered User
    Join Date
    02-21-2005
    Posts
    56
    No, sorry! I just checked and for some reason it won't accept that. Try this instead - I have checked this definitely works!

    =if(mod(cell,10)=0,TRUE,FALSE)

    Alastair

  5. #5
    Registered User
    Join Date
    05-17-2005
    Posts
    13
    Alastair,

    Thanks so much, that will do great.
    Last edited by o5prey; 05-17-2005 at 02:18 PM.

  6. #6
    Registered User
    Join Date
    02-21-2005
    Posts
    56
    Not a problem, cheers for the feedback, and sorry for the confusion!

    Alastair

  7. #7
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    And just to clear up the issue with the first solution, the formula returns a TEXT value, so the test must check for TEXT, as such:

    =IF(RIGHT(A1,1)="0",TRUE,FALSE)

    note the "0" in the test returns True for values of 10, 20, etc.

    HTH

    Bruce
    Bruce
    The older I get, the better I used to be.
    USA

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1