+ Reply to Thread
Results 1 to 7 of 7

numbers divisible by 20%

  1. #1
    Registered User
    Join Date
    03-09-2011
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    1

    numbers divisible by 20%

    Hello All -

    I am trying to get my head around this and have not been able to, so hopefully someone can help me out.

    I have a number is Cell F5 and I need to check to see if it is divisible by 20%

    If that number is divisible by 20% I need to divide it by 20%
    If it is not divisible by 20% I need to round it down to be divisible by 20% and display that value in cell G5. I know that is hard to read but I do not know how else to explain it.

    Basically if I have a number in F5 - Let’s say a 5, I know that is evenly divisible by 20% so the value is 1

    But if the number in F5 is let’s saying a 7, I need G5 to display the value as if it was a 5.

    Thanks for the help - if it can even be done.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: numbers divisible by 20%

    you don't mention what you expect the answer to be, but perhaps something like:

    =INT(F5/0.2)

    or

    =INT(F5 * 0.2)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

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

    Re: numbers divisible by 20%

    Hi sjc619 and welcome to the forum,

    Divisibility deals with LCM and GCD stuff. I think you really want to know if a number is divisible by 5, based on your examples.

    This means 5, 10, 15, 20 are all your lucky numbers

    To trim 7 down you need to do a MOD function. That is the remainder after division. So
    Mod(7,5) = 2 - In words is the remainder after dividing 7 by 5.

    So you have 33 and you want to get it down to 30 so it is your 20% divisible number

    You take the number 33 and subtract MOD(33,5) which is 3 or 33 - 3 = 30

    So in A1 is say 54. In B2 = A1 - MOD(A1 , 5) ....... And this will come out to be 50.

    I think this is what you want.
    Last edited by MarvinP; 03-09-2011 at 02:09 AM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: numbers divisible by 20%

    =if(mod(f5,5)<>0,int(f5/5)*5,f5)

  5. #5
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: numbers divisible by 20%

    =ROUND(F23/5,0)*5
    this also work

  6. #6
    Registered User
    Join Date
    11-17-2011
    Location
    lahore
    MS-Off Ver
    Excel 2012
    Posts
    4

    Re: numbers divisible by 20%

    You can also do something like this:

    = 5 * INT(F5 / 5)

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: numbers divisible by 20%

    or
    =FLOOR(F5,5)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ 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