+ 5
Good day Tim Fussnegger! In this case you may consider to use decimal instead of double for more accurate result.
You may find out more information at link below:
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types
Hopefully it helps! 😉
+ 6
Tim Fussnegger You're welcome and hope it's working well or otherwise please keep us updated! 😊
+ 5
Tim Fussnegger I'm agree with Fernando Pozzetti, addition information (dataset, Excel & C# formula) will definitely help to troubleshoot the problem.
+ 2
Show your code.
+ 1
Can you add pictures, or the code of both Excel and your program? I am far from being an expert in Excel, but, that way I would be able to check it out.
0
Differences happen because you are not explicitly telling the code to round up, down, or what to do if the result is .5
Always use doubles and tell your code/application to behave the same way by using math functions to round your result, such as Ceiling, Floor, Abs, etc.