Results 1 to 3 of 3
  1. #1
    Eastbay2 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    1

    #Num! error in my formula

    Hello,



    I'm receiving this error "#Num!" in my formula within Access. Here is my formula:


    FW Ratio 30/50: Format(Nz([Store_level_Markdown_3]![FW 30% UNIT])/(Nz([Store_level_Markdown_3]![FW 30% UNIT])+Nz([Store_level_Markdown_3]![FW 50% UNIT])),"0%") & " / " & Format(1-(Nz([Store_level_Markdown_3]![FW 30% UNIT])/(Nz([Store_level_Markdown_3]![FW 30% UNIT])+Nz([Store_level_Markdown_3]![FW 50% UNIT]))),"0%")

    My issue, in a few rows of data, is caused by me trying to divide zero by zero. It has taken me a while to get the formula where it is now and i can’t seem to solve this issue. I'm fine with it just saying "0", "-" or "None" or anything else in this situation other than the error.

    Thanks.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Check your use of the Nz function, I don't think you have a "value-if-null" .

    see http://www.techonthenet.com/access/f...dvanced/nz.php

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Forgetting about the Format function and the NZ function, you have two division formulas. If either field [FW 30% UNIT] or [FW 50% UNIT] is NULL or Zero, the division will fail.

    So first you have to check if both of the fields are either NULL or Zero. I would use the IIF() function. If both of the fields are either NULL or Zero, then return a zero. If one of the two fields is not NULL or not zero, then do the calc.

    Try this in your query:
    Code:
    FW Ratio 30/50: iif(nz([Store_level_Markdown_3]![FW 30% UNIT],0)=0 AND nz([Store_level_Markdown_3]![FW 50% UNIT],0)=0,0,Format(Nz([Store_level_Markdown_3]![FW 30% UNIT],0)/(Nz([Store_level_Markdown_3]![FW 30% UNIT],0)+Nz([Store_level_Markdown_3]![FW 50% UNIT],0)),"0%") & " / " & Format(1-(Nz([Store_level_Markdown_3]![FW 30% UNIT],0)/(Nz([Store_level_Markdown_3]![FW 30% UNIT],0)+Nz([Store_level_Markdown_3]![FW 50% UNIT],0))),"0%"))

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 10-22-2012, 06:11 AM
  2. ERROR msg WHILE USING IIF FORMULA
    By CUCKOO in forum Access
    Replies: 9
    Last Post: 10-03-2012, 12:40 PM
  3. getting a #error from count(iif( formula
    By vickan240sx in forum Access
    Replies: 1
    Last Post: 09-21-2012, 08:34 PM
  4. Formula
    By Ray67 in forum Queries
    Replies: 53
    Last Post: 08-09-2012, 01:56 AM
  5. Error in Formula
    By TheProfessorIII in forum Access
    Replies: 9
    Last Post: 03-21-2011, 05:50 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums