Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SB SB is offline
external usenet poster
 
Posts: 1
Default MOD function not returning exact zero

Hi there!

I am working with the excel MOD function.
MOD(n,d)

n = 2929.68750000
d = 418.5267857

I expect the answer to be zero.
However, Excel is returning: -5.68434E-14

I have numerous incidences of this in my spreadsheet and
these values are messing up the worksheet

How does this occur and, more importantly, is there any way to
resolve this?

Regards
SB

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default MOD function not returning exact zero

It occurs because, just as most numbers cannot be exactly represented by
a fixed number of decimal digits, most numbers cannot be exactly
represented by a fixed number of binary digits, which is what XL (and
every other spreadsheet) uses to store and calculate with.

You can use =ROUND(MOD(n,d),x) to fix the problem with an arbitrary
precision (e.g., x=10 rounds to the tenth decimal place).

See here for mo

http://cpearson.com/excel/rounding.aspx





In article . com,
SB wrote:

Hi there!

I am working with the excel MOD function.
MOD(n,d)

n = 2929.68750000
d = 418.5267857

I expect the answer to be zero.
However, Excel is returning: -5.68434E-14

I have numerous incidences of this in my spreadsheet and
these values are messing up the worksheet

How does this occur and, more importantly, is there any way to
resolve this?

Regards
SB

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 772
Default MOD function not returning exact zero

Hit the comma button in your menu bar and it should return it as 0, if not
you will have to round.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"SB" wrote:

Hi there!

I am working with the excel MOD function.
MOD(n,d)

n = 2929.68750000
d = 418.5267857

I expect the answer to be zero.
However, Excel is returning: -5.68434E-14

I have numerous incidences of this in my spreadsheet and
these values are messing up the worksheet

How does this occur and, more importantly, is there any way to
resolve this?

Regards
SB


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert row to EXACT function MicroDonna Excel Worksheet Functions 3 January 15th 06 10:21 AM
Function to find only exact matches in spreadsheets? Pam1288 Excel Worksheet Functions 3 January 10th 06 06:19 PM
EXACT function chrisrowe_cr Excel Discussion (Misc queries) 1 July 26th 05 01:29 PM
MATCH function - 2 columns w/ SIMILAR, not EXACT data Jane Excel Worksheet Functions 3 March 5th 05 03:11 AM
Use of Exact(or other) function for alternate rows? yusee_ygs Excel Worksheet Functions 2 November 3rd 04 08:44 PM


All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"