Forum Discussion
tkboisvert
4 years agoHelper II
Unexpected modulo behavior
Hi all,
In excel, I have this formula:
MOD(-10 + 9,12) + 1
And the expected result is 12
However, in PowerQuery the same formula:
Number.Mod(-10 + 9, 12) + 1
Results in 0
The strange thing is that for other numbers ( -1 ) I get the same result in both systems..
I expect this to have something to do with the nature of MOD, and how I'm using negative numbers.. But I would still like to know which is 'correct'..
Hi tkboisvert,
The way the formulas is calculated is slightly different between the two functions.
Check out this video: https://www.youtube.com/watch?v=K4ImPRsi3vg&ab_channel=ExcelIsFun
Kim
3 Replies
- KNPSuper User
Hi tkboisvert,
The way the formulas is calculated is slightly different between the two functions.
Check out this video: https://www.youtube.com/watch?v=K4ImPRsi3vg&ab_channel=ExcelIsFun
Kim
- tkboisvertHelper II
Thank you!
- Greg_DecklerCommunity Champion
tkboisvert According to Modulo Calculator (calculators.org), Power Query is correct.