Please, dont focus on that loop, I didn`t add a loop in attachment, just subroutine. The thing is that this subroutine is inside the loop. abstractly it should look like
do until eof(sample_data)
In the same if-then-else system i have a different results running it under fortran and under VBA. E.g. If I`m processing input_data file with 2250 records, the summoned parameters, like "sumBy" here, it differ about 0,5% of it`s value. In fortran it`s 1085, in VBA - 1045.
If someone wants to play around with this and prove me wrong, I`m adding full code in attachment.