Hi there,
I have created an iterative macro (attached: "iterative macro") in order to calculate payments for staff. To do this calculation, I need to sum three columns together - [KE: Actual Weekly Gross] + [AWE Allowances] + [MZ]. These three fields sum to the field [NA (AWE)]. Once [NA (AWE)] is calculated, the prior 52 values of this entry are summed to create the field [KN].
The value for [MZ] is variable, whilst [KE: Actual Weekly Gross] and [AWE Allowances] is fixed (coming straight from the raw data file - "v5.0 main - interim results". As [MZ] is variable, and [NA (AWE)] is calculated based off prior entries, this needs to be an iterative macro. Now this is where it gets interesting..
The sum for [NA (AWE)] computes fine, however when I try and do the sum function for [KN], it computes accurately at first, however eventually starts creating variances from what is expected.
I suspect this is being by [MZ] being computed a number of times in the macro (and hence in the final output being wrong), however I am not sure.
If anyone could please help, that would be much appreciated!
I have attached the following:
- main workflow.yxmd - this is the overarching flow
- iterative macro.yxmc - this is the iterative macro
- v5.0 main - interim results.xlsx - this is the raw data feeding the macro
- 00533283.3.xlsx - this is the output file produced.

Note, I have annotated the output excel file showing a manual comparison for what should be output and also the variance between expected and actual results.
Thank you.