Formula to handle null vs not null

Field A is a number field and some records have a null value.
Field B is a number filed and the records have no null values.

I need a formula for a new field "C" that places that does an IF kind of thing

IF Field A is not null, THEN put "A - (whatever the number in Field A is)" in Field C
Otherwise, put "B - (whatever the number in Field B is)" in Field C.
K_DeutschAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

als315Commented:
In field C you can use:
=IIF(isnull([FIELD_A]), [FIELD_B], [FIELD_A])

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeOwner, Developing Solutions LLCCommented:
First, I would recommend against filling in a field with a computed value based on these other two fields.  Unless you have a data macro which will automatically update [FieldC] every time a change is made in [FieldA] or [FieldB], you are far better off computing the value that would be [FieldC] every time you need that value (in a query).

Not quite sure I understand your logic.  Won't the following always equal zero:

A - (whatever the number in Field A is)
B - (whatever the number in Field B is)

To add or subtract values that may contain NULLS, you should use the NZ function to convert the value to a zero before performing arithmetic, something like:

FieldC: NZ([FieldA], 0) + NZ([FieldB], 0)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.