Consulting

Results 1 to 5 of 5

Thread: Round down to nearest 5,000

  1. #1
    VBAX Mentor
    Joined
    Aug 2011
    Posts
    353
    Location

    Round down to nearest 5,000

    Is there a way to roundown to the nearest 5,000?

    So if its 8,000 - that would be rounded down to 5,000
    If its 480,000 - that would be rounded down 450,000

    and if its below 5,000 - round down to zero


    Any ideas?

    I know about the rounddown function but am not sure what to put in there to make it round down to the nearest 5,000?

  2. #2
    VBAX Mentor
    Joined
    Feb 2009
    Posts
    493
    Location
    I believe you need the analysis pack installed for this. I got this from a google search.

    =MROUND((A1-5000/2),5000)
    Last edited by Aussiebear; 04-02-2025 at 01:03 PM.
    -----------------------------------------
    The more you learn about something the more you know you have much to learn.

  3. #3
    VBAX Expert CatDaddy's Avatar
    Joined
    Jun 2011
    Posts
    581
    Location
    roundedInteger = (CInt(unroundedNumber)/5000)*(5000)
    integer division uses whole numbers so the result of an integer divided by 5000 will be the largest whole number quotient (the modulus would give the remainder of this division)
    Last edited by Aussiebear; 04-02-2025 at 01:03 PM.
    ------------------------------------------------
    Happy Coding my friends

  4. #4
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,776
    How about
    =FLOOR(A1, 5000)
    Last edited by Aussiebear; 04-02-2025 at 01:04 PM.

  5. #5
    VBAX Mentor
    Joined
    Aug 2011
    Posts
    353
    Location
    This one works too!

    =FLOOR(A1, 5000)
    Thanks for the help!
    Last edited by Aussiebear; 04-02-2025 at 01:04 PM.

Posting Permissions

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