+ Reply to Thread
Results 1 to 5 of 5

MOD() Function Returns #NUM! Error Value

  1. #1
    Registered User
    Join Date
    07-15-2004
    Location
    Göttingen, Germany
    MS-Off Ver
    MS Office Pro Plus 2016
    Posts
    60

    MOD() Function Returns #NUM! Error Value

    Hi,

    I am trying to create IBAN numbers, so have a formulae with fairly large numbers. I need to do something like this for part of the calculation:

    =MOD(C7,97)

    C7 could be something like this : 500105170123456799131400

    Now, all I get is a #NUM! error. So, I found some info on a very old Microsoft KB explaining how this could be a problem, but that this should work:

    =C7-(INT(C7/97)*97)

    However, this returns the same error.

    Does anyone know if this function is simply useless, or if Excel struggles with a number this size in formulae of this nature?

    Thanks

    Paul

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: MOD() Function Returns #NUM! Error Value

    Excel may only use 15 significant digits in numbers.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Registered User
    Join Date
    07-15-2004
    Location
    Göttingen, Germany
    MS-Off Ver
    MS Office Pro Plus 2016
    Posts
    60

    Re: MOD() Function Returns #NUM! Error Value

    That explains the problem then!

    Thank you.

    Paul

  4. #4
    Registered User
    Join Date
    07-15-2004
    Location
    Göttingen, Germany
    MS-Off Ver
    MS Office Pro Plus 2016
    Posts
    60

    Re: MOD() Function Returns #NUM! Error Value

    Just out of interest... I did eventually find a workaround...

    ="DE"&98-MOD(MOD(MOD(MOD(MID(+C5&IF(LEN(C4)=6,"0000",IF(LEN(C4)=7,"000",IF(LEN(C4)=8,"00",IF(LEN(C4)=9,"0",
    IF(LEN(C4)=10,"")))))&C4&131400,1,6),97)&MID(+C5&IF(LEN(C4)=6,"0000",IF(LEN(C4)=7,"000",IF(LEN(C4)=8,"00",
    IF(LEN(C4)=9,"0",IF(LEN(C4)=10,"")))))&C4&131400,7,6),97)&MID(+C5&IF(LEN(C4)=6,"0000",IF(LEN(C4)=7,"000",
    IF(LEN(C4)=8,"00",IF(LEN(C4)=9,"0",IF(LEN(C4)=10,"")))))&C4&131400,13,6),97)&MID(+C5&IF(LEN(C4)=6,"0000",
    IF(LEN(C4)=7,"000",IF(LEN(C4)=8,"00",IF(LEN(C4)=9,"0",IF(LEN(C4)=10,"")))))&C4&131400,19,6),97)&C5&
    IF(LEN(C4)=6,"0000",IF(LEN(C4)=7,"000",IF(LEN(C4)=8,"00",IF(LEN(C4)=9,"0",IF(LEN(C4)=10,"")))))&C4

    Unfortunately this doesn't catch every case and I think it may actually be impossible to catch them all with excel because of the way the codes are actually generated (meaning you may need more than just the account number and sort code)... but it was interesting having a play around.

    Thanks

    Paul

  5. #5
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: MOD() Function Returns #NUM! Error Value

    Thank you for posting - interesting workaround!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] User defined function returns an error on a standard function used in it.
    By pb48 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2013, 01:35 PM
  2. [SOLVED] Sumif function returns a #Value! error
    By Kalts in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2012, 07:50 AM
  3. Function Returns Value Error
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2011, 10:28 AM
  4. [SOLVED] sumproduct function returns #value or #ref error
    By Leo Heuser in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 12:05 PM
  5. [SOLVED] sumproduct function returns #value or #ref error
    By Jennie in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1