+ Reply to Thread
Results 1 to 3 of 3

Simple MOD query

  1. #1
    Registered User
    Join Date
    04-21-2011
    Location
    Seattle, WA, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Exclamation Simple MOD query

    I'm trying to do some conditional formating here.
    I've 17R x 5C table.

    1) I want to highlight certain cells in first 3 columns that are divisible by 8 and highlight cells last 2 columns that are divisible by 8.8
    - I could make the first part work by using formula MOD(A1,8)
    - Need help on second. MOD(D1,8.8) seems mathematically incorrect

    2) Why is that the answers for 2 formulas below are different?
    =MOD((132/8.8),1)
    =MOD((15),1)

    If I evaluate MOD((132/8.8),1) ; it becomes MOD(15,1) which is 0 but I get -1.77636E-15

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Simple MOD query

    Hi rajivvishwa and welcome to the forum.

    I thought MOD was the remainder after division. So 22 MOD 5 (or Mod(22,5) is 4 with a remainder of 2.

    It just doesn't make sense to me to have a decimal divisor like 8.8.

    Maybe the alternate formula shown on http://office.microsoft.com/en-us/ex...005209182.aspx will help with this problem.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Simple MOD query

    first 3 columns
    =AND(A1<>0,MOD(A1,8)=0)
    last 2 columns
    =AND(D1<>0,ROUND(MOD(D1,8.8),2)=0)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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