+ Reply to Thread
Results 1 to 11 of 11

Rounding number based on arbitrary value

  1. #1
    Registered User
    Join Date
    03-12-2014
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    39

    Rounding number based on arbitrary value

    Good day everyone,

    I have this simple problem but complicated, that I couldn't think of how to formulate it in excel.

    I want to have a cell that can result based on the reference value set before it, e.g.

    I have a result cell in A1 = 5, the reference number in B1 = 4.5.

    My formula is =IF(B1<5, "5", "0"), it works but when I change the reference cell B1 bigger than 5, it shows 0.

    Can anyone help me to formulate a formula that can adjust to any number I put? Because I'm working in a series calculation, so the cell B1 value may change bigger than 5.

    I hope you can understand what I am trying to say and I really appreciate for any help!!!
    Last edited by hamidun; 12-06-2016 at 02:57 AM.

  2. #2
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Slough
    MS-Off Ver
    Excel 2007
    Posts
    469

    Re: What formula should i use?

    This formula says that if B1 is lower than 5 then the answer is 5. If it is higher than 5 then it is 0 so the formula is working fine?

    What do you want the cell to equal if B1 is greater than 5?

  3. #3
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    425

    Re: What formula should i use?

    Will this work?

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If B1 is less than 5 , the result will be 5
    Otherwise the result will be the value in B1 itself.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: What formula should i use?

    Please change your thread title:

    1. Use concise, accurate thread titles. Your post title should describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change the title of the thread, click EDIT on the original post, then click the Go Advanced button, then change the title. If two or more days have passed, the EDIT button will not appear, and you need to ask a moderator to change the title.

  5. #5
    Registered User
    Join Date
    03-12-2014
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: What formula should i use?

    Chullan88

    Your formula is working!

    However, actually this formula is for a series of calculation and the formula in A1 is basically for rounding the value, e.g

    The cell B1 is 4.25, I need in A1 to be rounded bigger than 4.25 which is 5. But for this formula =IF(B1<5,5,B1), when I set the B1 7.1 the result is 7.1 not 8...

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: Rounding number based on arbitrary value

    Try this ...

    =MAX(5,ROUNDUP(B1,0))

  7. #7
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    425

    Re: What formula should i use?

    Quote Originally Posted by hamidun View Post
    Chullan88

    Your formula is working!

    However, actually this formula is for a series of calculation and the formula in A1 is basically for rounding the value, e.g

    The cell B1 is 4.25, I need in A1 to be rounded bigger than 4.25 which is 5. But for this formula =IF(B1<5,5,B1), when I set the B1 7.1 the result is 7.1 not 8...


    try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-12-2014
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Rounding number based on arbitrary value

    Quote Originally Posted by Phuocam View Post
    Try this ...

    =MAX(5,ROUNDUP(B1,0))
    This works very well!! Thanks Phuocam... I have changed 5 to 0, and now it works for any value!

    Just want to ask, if there is any command that can result only for EVEN number, e.g.

    The reference number is 4.5 and the rounded result will be 6, is there any kind of command that work in that way?

  9. #9
    Registered User
    Join Date
    03-12-2014
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: What formula should i use?

    Quote Originally Posted by chullan88 View Post
    try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Yeah this also works!! Thanks chullan88!!

  10. #10
    Registered User
    Join Date
    03-12-2014
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Rounding number based on arbitrary value

    Well guys, I did formulate that result only for EVEN number by using EVEN function. So, this thread is solved...

    Once again, Thanks for your time and help chullan88 and phuocam!!!

  11. #11
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    425

    Re: Rounding number based on arbitrary value

    If your problem is solved,please add rep for those who have helped.


    Thanks

+ 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. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  2. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 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