Nearest whole number to divide by to be near a value

Caly

Board Regular
Joined
Jul 19, 2015
Messages
159
Office Version
  1. 365
  2. 2013
  3. 2011
  4. 2010
  5. 2007
Platform
  1. Windows
Hello I have a range of numbers and need to make a formula where that larger number can easily be divisible by a whole number in order to then have the price be near $20. It can be above or below but as close as possible to $20.

I know I’m sure I can use Goal Seek however I need to have it be a formula to be applied to the range of number variations.

Example below
Values the largest number is where these need to be divisible down to a whole number that is lower

144
24
72
50
45
5
2


these each have different prices
Value. Price
144. 3.25
24. 0.80
72. 9.75
50. 4.33
45. 1.24
5. 8.76
2. 0.22

So for instance with the 144 value that has a price of 3.25, what is the nearest whole number the 144 can be broken down to to make the total value of that multiples by the price to be near $20? Like how many units are needed to be divided down using the 144 that would be a whole number to be close either above or slightly below $20 order value?

PriceValueDivisible number from the Value columnOrder ValueNotes/DetailsPossible divisible numberOrder valueDetails
3.25144'=B2/xxx=C2*A2Need to divide 144 by a number that will be a whole number but that number needs to be the closest value that will be near $20.=144/24 which comes to 6=6 *3.25 which comes to 19.50I did this manually but need a formula to copy down for all cells to do the calculation
0.824
9.7572
4.3350
1.2445
8.765
0.222
Range for order value
$20

Also asked here Help with formula to be divisible by a whole number
 
Last edited by a moderator:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Very odd as I get
Fluff.xlsm
ABE
1PriceValue
23.251440
30.8241
49.75720
54.33500
61.24450
78.7654
80.22210
Lists
Cell Formulas
RangeFormula
E2:E8E2=LET(a,INT(CEILING(20,$B2)/$B2),IF(ABS(a*$B2-20)>ABS((a-1)*$B2-20),a-1,a))
 
Upvote 0
It is working ok.

Sl nOPriceValueAmountCheck Value
13.25144619.5
20.8242520
39.7572219.5
44.3350521.65
51.24451619.84
68.765217.52
70.2229120.02
 
Upvote 0
I had not realised that you had decided to move the columns. I assumed that you were using the OP's data as posted.
 
Upvote 0
Thank you all so much. Is there a way to have it go to the value will be as high as possible to $20?

For instance if the price is 0.66 and the Value is 48, using =round(0.66/20,0) comes to 2. Taking the 2 result multiplied by the price 0.66 equals 1.32 for the order value. But I am looking for the highest value which should be 24 which the 24 multiples by the 0.66 price is 15.84

Is there a simple formula to write to take the maximum whole number to get close to the $20?
 
Upvote 0
Apologies sorry I wrote it backwards … it is working perfectly now thank you everyone in the group. You are all great.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,068
Messages
6,122,950
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top