# Convert Excel formula that includes IfError to Access

I have an Excel formula that looks like:

=IFERROR((MAX((((G11-\$M\$5)*F11)*\$M\$6),0)),"")

The corresponding Access form fields are:

G11 = txtMST
M5 = txtMoistureMax
F11 = txtCleanCWT
M6 = txtDisSchd1

How do I convert this to Access?
Asked:
###### Who is Participating?
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.

Senior developer, analyst and customer assistance Commented:
Something like
IIF ((((txtMST-txtMoistureMx)*txtCleanCWT)*txtDisSchd1) <= 0,0,"")
0
CIOCommented:
I guess it catches an error condition where a cell could be empty. If so, for the calculation:

``````= IIf((txtMST - txtMoistureMax) * txtCleanCWT * txtDisSchd1 >= 0, (txtMST - txtMoistureMax) * txtCleanCWT * txtDisSchd1, 0)
``````
or to catch the error to return 0 instead of Null:

``````= IIf((Nz(txtMST, 0) - Nz(txtMoistureMax, 0)) * Nz(txtCleanCWT, 0) * Nz(txtDisSchd1, 0) >= 0, (Nz(txtMST, 0) - Nz(txtMoistureMax, 0)) * Nz(txtCleanCWT, 0) * Nz(txtDisSchd1, 0), 0)
``````
0

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.

Author Commented:
This was perfect...

= IIf((Nz(txtMST, 0) - Nz(txtMoistureMax, 0)) * Nz(txtCleanCWT, 0) * Nz(txtDisSchd1, 0) >= 0, (Nz(txtMST, 0) - Nz(txtMoistureMax, 0)) * Nz(txtCleanCWT, 0) * Nz(txtDisSchd1, 0), 0)
0
Author Commented:
And I'm going to post another formula issue titled, "Final Excel to Access calculation issue"
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.