473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dividing by Zero.......avoid the #Num! from displaying

kcdoell
230 100+
Hello:

I have three unbound text boxes in which I have the following calculations in the control source of each box:

FCST Total; [SumGWP]
Expand|Select|Wrap|Line Numbers
  1. =Nz(DSum("[GWP]","ReQryForecast","[Binding_Percentage] >= 75"),0)
Budget Total; [TxtBudGWP]
Expand|Select|Wrap|Line Numbers
  1. =Nz(DSum("[SumOfGWP]","QryBudget_Sum"),0)
FCST vs. Budget; [FCSTvsPrior_GWP]
Expand|Select|Wrap|Line Numbers
  1. =(Nz(Forms!Forecast!SumGWP,0)-Nz(Forms!Forecast!TxtBudGWP,0))/Nz(Forms!Forecast!TxtBudGWP,0)
My issue is that when [TxtBudGWP] is “0” I get a #Num! In my [FCSTvsPrior_GWP]. I know in one case, [FCSTvsPrior_GWP] would be doing a calculation of (0-0)/0. How can I avoid the #Num! from displaying or how can I compensate for the scenario of a calculation that is dividing by zero?

Thanks,

Keith.
May 5 '08 #1
2 2703
kcdoell
230 100+
I solved it!

Expand|Select|Wrap|Line Numbers
  1. =IIf([TxtBudGWP]=0,0,(([Forms]![Forecast]![SumGWP])-([Forms]![Forecast]![TxtBudGWP]))/([Forms]![Forecast]![TxtBudGWP]))
  2.  
Thanks,

Keith
May 5 '08 #2
NeoPa
32,556 Expert Mod 16PB
That's about the size of it Keith :)
May 5 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

65
by: Pmb | last post by:
I'm confused as to what the compiler error message I'm getting is refering to. Can someone take a gander and let me know what I did wrong? The program is below. When I compile it I get the...
33
by: Jim Cobban | last post by:
I cannot get Netscape 4.79 to properly display the ordered list in the following fragment. <P>Get a specific portion of the date. Depending upon the value of index: <ol start=0> <li>complete...
4
by: shuisheng | last post by:
Dear all, Assume I have two big arrays A and B. And I want to element-wise divide A by B. When an element of B is zero, the results are also zero. Such as A = { 2, 4, 0, 6} B = { 1, 0, 0, 2}...
16
by: Richard Maher | last post by:
Hi, I have this Applet-hosted Socket connection to my server and in an ONevent/function I am retrieving all these lovely rows from the server and inserting them into the Select-List. (The on...
8
by: Andrew Poulos | last post by:
In my limited testing with FF 2, IE 6 and Opera 9 when I divided a positive integer, that is less than 100, by 100 I get a leading zero in front of the decimal point. For example 80/100 gives...
4
by: H.S. | last post by:
Hello, I am trying out a few methods with which to test of a given number is practically zero. as an example, does the following test correctly if a given number is zero within machine...
7
by: southernsunsations | last post by:
/******************************************************************\ * * * * Date: 09.06.2007 ...
9
ollyb303
by: ollyb303 | last post by:
Hi, I have created a report in my Access db which has two columns - I'll call them Number1 and Number2. I have added a textbox to calculate a percentage from these two numbers =(/) with the...
9
by: Dhiru1009 | last post by:
Hi guys, I am trying to build a user registration form using PHP and MYSQL but encountring a problem. When I click on submit with empty fields it adds records to database also it doesn't matter...
1
by: zufie | last post by:
This is my original equation: =(/)*100 When the denomimator is zero I am unable to calculate the percentage. I tried changing my equation to this format: =IIf( = 0, 0, / ) I also tried:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.