#Type! Error (1 Viewer)

dmyoungsal

Registered User.
Local time
Today, 04:09
Joined
May 1, 2016
Messages
112
The following formula is giving me a "#Type!" message in a text box.

=Nz([Cat1T],0)+Nz([Cat2T],0)+Nz([Cat3T],0)+Nz([Cat4T],0)

I have two other textboxes doing a similar formula and they work fine. I cannot figure out the cause. The two working formulas are below:

=Nz([T1Load],0)+Nz([T2Load],0)+Nz([t3load],0)+Nz([t4load],0)
=Nz([T1],0)+Nz([T2],0)+Nz([t3],0)+Nz([t4],0)

in the cells feeding to the first formula, the formula is: =IIf([Cat1Ea]="","",([Cat1Ea]*[txtcount1]))

If I change the IIF statement to be =IIf([Cat1Ea]="",0,([Cat1Ea]*[txtcount1]))
the error disappears.
 

Minty

AWF VIP
Local time
Today, 12:09
Joined
Jul 26, 2013
Messages
10,370
When you set the value to "" you are creating a string - you can't multiply a string by a Numeric value
 

dmyoungsal

Registered User.
Local time
Today, 04:09
Joined
May 1, 2016
Messages
112
When you set the value to "" you are creating a string - you can't multiply a string by a Numeric value

The Type error shows until I have all 4 preceeding text boxes filled. (The formulas work). The issue is the formula containing the "NZ" (not the multiplication calculations)
 

dmyoungsal

Registered User.
Local time
Today, 04:09
Joined
May 1, 2016
Messages
112
I found the solution to me problem:

Changing the True part of the formula (=IIf([Cat1Ea]="","",([Cat1Ea]*[txtcount1])) from "" to null, made the error disappear.


The working formula is: =IIf([Cat1Ea]="",null,([Cat1Ea]*[txtcount1]))

Thank you
 

Minty

AWF VIP
Local time
Today, 12:09
Joined
Jul 26, 2013
Messages
10,370
The Type error shows until I have all 4 preceeding text boxes filled. (The formulas work). The issue is the formula containing the "NZ" (not the multiplication calculations)

My point, that you have reached, was that by having the possibility of the result of the Nz() Function being "", would mean your multiplication would then involve a string which was giving you the #Type error.

Glad you sorted it out.
 

Users who are viewing this thread

Top Bottom