+ Reply to Thread
Results 1 to 5 of 5

Solver rounding

  1. #1
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Solver rounding

    Hey,

    I am currently running solver in my spreadsheet. The results are giving me a precise number. IE> 9.14567891543 or 4.015615404866. Is there a way to give it a rounded answer. 1 decimal place ie. 9.1 or 4

    Now the trick is i dont want to round it after as i need the overall result equal 100. Here is my VBA for solver:

    Please Login or Register  to view this content.
    Thanks in advance,

  2. #2
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: Solver rounding

    Ive tried formating the cells, before and after but it doesnt work with the overall number. it doesnt equal 100. (rounding to 1 decimal place)

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,445

    Re: Solver rounding

    Have you tried setting a constraint in Solver that the overall has to =100?

    If that isn't going to do it, you may have to upload an actual spreadsheet so someone can see what you are calculating, how you are calculating it, and what Solver is trying to optimize.

  4. #4
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: Solver rounding

    I have a constraint that it has to equal a 100, but my issue is i want the solution to be rounded. IE A=9.46589 B=1.451684 C=50.156431223 and soo on.. I need it to be: A=9.5 B=1.5 C=50.2......and so on. But without it being rounded in the solver it wont work as it will have a rounding issue once totaled. not exactly 100? understand? is there a way to tell solver that the viable solutions in the feasible region must be with only 1 decimal place.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,445

    Re: Solver rounding

    It's not going to be an option built into Solver. I'm sure someone clever with a spreadsheet iin front of them could look at the problem as a whole and see some combination of additional functions/constraints that would control the number of digits allowed.

    One idea -- one possible constraint is to constrain a cell to be an integer. Perhaps rework the spreadsheet so that your changing values are 10x the current set. Then you could tell Solver to constrain those to integers and see if it finds a workable solution. You'll know that your real solutions are 1/10th the value that Solver comes up with.

+ 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