I didn’t know this before today when an user at MrExcel wondered why he was not getting consistent answers with Excel and VBA. The key is negative numbers.
If you happen to have negative numbers (one of them) and you want to calculate MOD, you should use this code in VBA
Where n is your number and d is your divisor.
For more info, check:
MOD Function and Mod Operator Return Different Values