1. ## IIF NZ (A2k)

Sorry but I'm having a brain block this morning.

Unbound text : =[TG]/[TT]

To handle Nulls, is it : =Nz([TG]) / Nz([TT]) or: =IIF([TT]=0),0,([TG]) / ([TT])

I know it's embarrassing but it might have been the beer last night !! <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

2. ## Re: IIF NZ (A2k)

A calculation like =[TG]/[TT] will result in Null (empty) if either of the arguments is Null (empty). It will result in #Div/0! if TT = 0. So there are two cases you have to handle here:
- What should the result be if TT = 0? If you want 0, try this:

=IIf([TT]=0,0,[TG]/[TT])

- Is it OK that the result is empty if either of the arguments hasn't been filled in? If so, you don't need to do anything about this; if you want to return 0, see the next item.
- If you want to return 0 if either of the arguments is Null (empty), expand the expression as follows:

=Nz(IIf([TT]=0,0,[TG]/[TT]),0)

3. ## Re: IIF NZ (A2k)

Thankyou Hans.

The second version suits my needs, any of the items may be Null.

#### Posting Permissions

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