Returning "$0.00" for anull value

tkopari

Board Regular
Joined
Apr 30, 2004
Messages
174
I hope this is an easy one. I'm writing a query that returns account numbers, the account allotment for the fiscal year, the amount they spent in two different categories and their account balance. I'm only getting data returned for those accounts that actually spent something. For those that didn't I'm getting a blank in the two spending categories and balance fields. I want "$0.00" returned in the two categories and the balance fields. How do I do it. I tried Iff(Null,"$0.00"), but that didn't work.

I'd appreciate any help anyone can give me.

Thanks!

Tony
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Tony

Take a look at the Nz function.
 
Upvote 0
Nz («expr», «valueifnull»)

Could you give me the correct syntax in an example? Would I write it like:

Nz(Null,$0.00)
 
Upvote 0
Nope.

The expr should be the field (or whatever) that could be null.
 
Upvote 0
I tried:

Nz([field name], 0)

and got only data returned for the accounts that spent in both categories. I want to get returns for all account showing $0.00.
 
Upvote 0
That's not where it should go.

What you should be doing is replacing the field with the expression or putting it alongside the field(s).
 
Upvote 0
Thanks! That returns 0s for me, but now I can't set the format to currency. They are all displaying as whole numbers and the format drop down is empty. How do I fix that?

I also applied this formula to the "Balance" field, which is a calculated field that subtracts the two types of expenditures from the FY allotment. I had to write the formula in the adjacent field and uncheck it. When it's unchecked I'm prompted for a value for 'Balance", when it's checked both the original "Balance" field and the new one with the Nz formula are displayed . What do I do to fix that?
 
Upvote 0
Well for the first part take a look at the Format function.

I don't quite understand your 2nd question because a calculation probably wouldn't return a Null value.

Again take a look at wrapping the calculation in Format.
 
Upvote 0

Forum statistics

Threads
1,212,928
Messages
6,110,737
Members
448,295
Latest member
Uzair Tahir Khan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top