Rounding to a quantity divisible by another listed quantity

DSEIDEN76

New Member
Joined
Oct 8, 2018
Messages
11
I'm having a math/excel problem. I have a sheet of values. In column A I have package quantities, column B a value that our system says to order. In column C I'd like to produce a value that is the nearest divisible number to what shows in column A.

A B C
PACKAGE SYS ORDER
50 20 (NEED FORMULA FOR THIS TO = 50)
40 60 (THIS WOULD NEED TO = 80)
35 40 (THIS WOULD NEED TO = 35)

The sheet will have a variable amounts of rows so i'll need to copy that to the last row as well.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Up until the 35,40 >> 35 example, I though that you were rounding up.
If you are rounding either direction, wouldn't the 50,20 desired result be 0?
 
Upvote 0
Good point. I think the majority of the time I'll want to round up since we're ordering product and don't want to run out, but if we're slighting above the package quantity needed we'd want to round down. I guess a round up formula would be okay and then we could manually look at it from there.
 
Upvote 0
Maybe...


[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
A
[/td][td="bgcolor: #DCE6F1"]
B
[/td][td="bgcolor: #DCE6F1"]
C
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
PACKAGE​
[/td][td]
SYS​
[/td][td]
ORDER​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
50​
[/td][td]
20​
[/td][td]
50​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
40​
[/td][td]
60​
[/td][td]
80​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
35​
[/td][td]
40​
[/td][td]
35​
[/td][/tr]
[/table]


Formula in C2 copied down
=IF(CEILING(B2,A2)-B2>ABS(B2-A2),FLOOR(B2,A2),CEILING(B2,A2))

M.
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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