+ Reply to Thread
Results 1 to 13 of 13

Round formula according the criteria

  1. #1
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Round formula according the criteria

    Hi Experts,
    I'm looking Round formula according the criteria, like that:


    if there is number 7,15 it will be rounded to 7.
    if there is 7,16 it will be rounded to 7,5
    if there is 7,65 it will be rounded to 7,5,
    if there is 7,66 it will be rounded to 8
    if there is 8,15 it will be rounded to 8,
    if there is 8,16 it will be rounded to 8,5.
    and so one, and before it.

    attached screenshot and excel file.

    Thank You in Advance,

    Farhan
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Round formula according the criteria

    In D7, try:

    =INT(B7)+LOOKUP(MOD(B7,1),{0,0.16,0.66},{0,0.5,1})

    You may have to adjust the formula if you are using commas instead of decimal points.

    I have attached the sheet for your reference (formula should automatically adjust).
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: Round formula according the criteria

    63falcondude, wow excellent.

    Thank you.

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Round formula according the criteria

    You're welcome. Thanks for the rep!

  5. #5
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: Round formula according the criteria

    little have a problem.

  6. #6
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: Round formula according the criteria

    the amount is not 7.15 this will be like that 7,15 when I using 7,16 formula is showing #value, can you fix it?

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Round formula according the criteria

    Attach the workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Round formula according the criteria

    D7 =substitute(int(substitute(b7,",",".")+0)+lookup(mod(substitute(b7,",",".")+0,1),{0,0.16,0.66},{0,0.5,1}),".",",")

  9. #9
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: Round formula according the criteria

    perfect 63falcondude .

  10. #10
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Round formula according the criteria

    Here is another way
    Enter in B7 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    then enter formula in D7 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B C D
    5
    6 actual Needed
    7 if there is number 7,15 it will be rounded to 7.* 7.15 7
    8 if there is 7,16 it will be rounded to 7,5* 7.16 7.5
    9 if there is 7,65 it will be rounded to 7,5, 7.65 7.5
    10 if there is 7,66 it will be rounded to 8* 7.66 8
    11 if there is 8,15 it will be rounded to 8,* 8.15 8
    12 if there is 8,16 it will be rounded to 8,5. 8.16 8.5
    13
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Round formula according the criteria

    Perhaps try this formula, it works for your examples

    =CEILING(A1-0.15,0.5)
    Audere est facere

  12. #12
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Round formula according the criteria

    Quote Originally Posted by daddylonglegs View Post
    =CEILING(A1-0.15,0.5)
    Clever. Since the OP's values are text and use commas instead of decimals, is there a better way to take this into consideration than converting to a value, CEILING calculation, then converting back to text value with commas?

    That is:

    =SUBSTITUTE(CEILING(SUBSTITUTE(B7,",",".")-0.15,0.5),".",",")

  13. #13
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Round formula according the criteria

    Quote Originally Posted by 63falcondude View Post
    Since the OP's values are text and use commas instead of decimals,
    Sorry, I missed that, I was assuming that the commas were alternative decimal separators. If text then, yes, that seems like a reasonable approach, although it seems odd to be rounding text values in the first place......

+ 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. Round down based on column B rounding criteria.
    By Andy308 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-20-2017, 07:03 AM
  2. Replies: 1
    Last Post: 09-04-2015, 04:06 PM
  3. Replies: 2
    Last Post: 12-06-2014, 01:58 PM
  4. [SOLVED] How to round to nearest .01 and round down if thousands place is .005
    By dredre609 in forum Excel General
    Replies: 5
    Last Post: 09-29-2014, 11:47 AM
  5. round up round down formula
    By m_789 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-04-2014, 05:34 AM
  6. Mulitple Criteria round 2
    By mjhopler in forum Excel General
    Replies: 4
    Last Post: 10-28-2009, 03:37 AM
  7. [SOLVED] How do I ROUND() round off decimals of a column dataset?
    By Højrup in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2005, 07:06 AM

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