Allocate Amounts without Rounding Errors

Biz

Well-known Member
Joined
May 18, 2009
Messages
1,773
Office Version
  1. 2021
Platform
  1. Windows
Hi,

I have got formulas working, but hoping if there's more streamline method.
The formulas that need to be streamlined are in Range(S31:U36).

Cell Formulas
RangeFormula
P31:P36P31=O31/(1-O31)
Q31:Q36Q31=(M31*(1+P31))*O31
S31:U36S31=IF(ROUND(ABS(SUM($R31:R31)+$Q31*(S$27/$O31)-$Q31),2)>0.01,ROUND($Q31*(S$27/$O31),2),ROUND($Q31*(S$27/$O31)+$M31-($Q31*(S$27/$O31)+SUM($R31:R31)),2))
W31:W36W31=SUM(S31:U31)
X31:X36X31=NOT(Q31=W31)


Your help would be greatly appreciated.

Kind Regards

Biz
 
Hi Hicksi,

I looked at your approach and it works with small rounding error but it adds in total.
I modified your formula
Copy S31 to U36
=IF(SUM($R31:R31)=0,ROUND(Q31*S$27/O31,2),ROUND($Q31*SUM($S$27:S$27)/$O31,2)-SUM(R31:$S31))

Kind Regards

Biz
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Just be careful with that...
The logic of the formula says that you are subtracting the 'previous'. For row 1 and column 1 (in your case 31 and S) there is only an implied zero sum. It only works because you have nothing in column R and row 30. Otherwise, it'll blow up big-time.
 
Upvote 0
HOLY SH!T.
That Works... No IF statement needed.
Because column R is empty (zero), each cell can be set with
T31 =ROUND($Q31*SUM($S$27:T$27)/$O$31,2)-SUM($R31:S31)

And yes, you WILL get some differences in individual cells. You are trying to round each individual value, whereas I am rounding the sum-of-the-values-so-far.
Mine (by definition) will always total correctly.
 
  • Like
Reactions: Biz
Upvote 0

Forum statistics

Threads
1,223,953
Messages
6,175,598
Members
452,658
Latest member
GStorm

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