+ Reply to Thread
Results 1 to 4 of 4

Personalized rounding function

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    madrid
    MS-Off Ver
    2010
    Posts
    26

    Personalized rounding function

    Hi guys !

    I would like to create a function which would round a number by looking first at the nearest lowest value in a range of cells. Like for instance, if i have 17.9, it would go for 15, which is the immediate lowest value in the table.

    Then, it would check if 17.9 belongs to the area going from this immediate lowest number to +15% of this number.

    Here, we would check if 17.9 belong to the area starting from 15 to 17.25. as it does not belong to it, we would take the immediate UPPER number (for instance 20 in the table).

    It it belongs to it, we would stay with the immediate LOWER number (here 15).

    Hope you can help me to manage that . I have some skills in vba, but when it is coming to create user defined functions i am a bit struggling...

    Thanks a lot!
    Last edited by TeloS53; 09-11-2015 at 06:30 AM.

  2. #2
    Registered User
    Join Date
    08-04-2009
    Location
    Golborne England
    MS-Off Ver
    2013
    Posts
    85

    Re: Personalized rounding function

    Hi TeloS53

    Add this function to a program module in the visual basic editor and then you can use this function anywhere you need in your spread sheet.


    Please Login or Register  to view this content.
    You can use it like any other function. (A1 is the cell with your value to test)

    Please Login or Register  to view this content.
    This is only my third user defined function so I am sure someone can improve on it.

    Cheers,

    JimBobBowie

  3. #3
    Registered User
    Join Date
    06-24-2015
    Location
    madrid
    MS-Off Ver
    2010
    Posts
    26

    Re: Personalized rounding function

    Thank you very much, works like a charm, one last question, how do i set the array automatically ?? It would be a whole range of values. Thanks a lot

  4. #4
    Registered User
    Join Date
    08-04-2009
    Location
    Golborne England
    MS-Off Ver
    2013
    Posts
    85

    Re: Personalized rounding function

    Hi TeloS53,

    Just edit the line that sets up the array. add as many values as you need.

    Please Login or Register  to view this content.
    Regards,

    JimBobBowie

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. personalized numbers format
    By CCFF in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-26-2015, 12:29 PM
  2. Dynamic or personalized hyperlink vba excel
    By SERRY in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-16-2015, 08:37 AM
  3. Finding Un - Personalized names
    By shyam sundar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2014, 02:51 AM
  4. Send personalized mass emails with multiple attachments
    By land_land in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2014, 01:45 AM
  5. Help on personalized "slope" function
    By excellina in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-19-2009, 06:02 PM
  6. personalized form data show
    By Isaac in forum Excel General
    Replies: 1
    Last Post: 07-06-2006, 06:15 AM
  7. how to get the rounding function off
    By Cynthia A in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-05-2005, 11:05 PM

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