will help you I want to show the values in the excel sheet such that , your question is pure math problem that can be rewritten as this:

```
x/y = z = (floor(100*x/y)/100)+d
```

```
d=(x/y)-(floor(100*x/y)/100)
```

```
x/y = z = (floor(100*x/y)/100)+(x/y)-(floor(100*x/y)/100)
```

```
D=d*y=d(0)+d(1)+d(2)+...+d(y-1)
```

```
D=x-((floor(100*x/y)/100)*y)
d(i)= floor(100*D/y)/100 i = { 1,2,3,...,y-1 }
d(0)=D-(y-1)*(floor(100*D/y)/100)
```

```
{ 0.01, 0.02, 0.03, ... , 0.11 }
```

```
D=x-((floor(100*x/y)/100)*y)
d(i)= floor(100*D/y)/100+0.01 i = <0 , y-1> AND i < 100*(D%y)
d(i)= floor(100*D/y)/100 i = <0 , y-1> AND i >= 100*(D%y)
```

```
int i,n,y=12; double x=10000.00,fy=y,z,D,d,s;
z=floor((100.0*x)/fy)*0.01; // cell value rounded
D=x-(z*fy); // global correction
n=floor((100.0*D)+0.5); // iregular remainder
for (s=0.0,i=0;i<y;i++)
{
d=0.01*floor(100.0*D/y); // regular local correction
if (i<n) d+=0.01; // iregular local correction
// z+d is the new cell value and s is the sum for check ...
s+=z+d;
mm_log->Lines->Add(AnsiString().sprintf("%3i: %5.2f",i,z+d));
}
mm_log->Lines->Add("--------------");
mm_log->Lines->Add(AnsiString().sprintf("sum: %5.2f",s));
```

```
0: 833.34
1: 833.34
2: 833.34
3: 833.34
4: 833.33
5: 833.33
6: 833.33
7: 833.33
8: 833.33
9: 833.33
10: 833.33
11: 833.33
--------------
sum: 10000.00
```