What change can I make to this formula to produce the desired output?

I would like to make a change to this formula in Excel.


If the field in D and E are both blank - then the output be blank.
Only if either field D or E are populated, then the output should reflect the initial amount in F297 plus any changes.

How can this be changed?
Who is Participating?

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

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.

ProfessorJimJamMicrosoft Excel ExpertCommented:

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
Gerwin Jansen, EE MVETopic Advisor Commented:
What if both D and E are populated?
Steven CarnahanNetwork ManagerCommented:
Use AND instead of OR


should be


Only I think what I have is:

=IF((AND(D298<1, E298<1)),0,F297+D298+E298)
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

100questionsAuthor Commented:
if D and E are populated - or whether D alone is populated or E alone is populated - then the output must be visible
Steven CarnahanNetwork ManagerCommented:
The formula I provided will only do the calculation if both D and E are not less than 1. It will not do the calculation if D and E is a negative number or any part of a number below 1 (0.8 for instance)
100questionsAuthor Commented:
I see.  The formula should be adjusted if any amount if populated in either D or E or both, even negative amounts.
Is this possible?
Steven CarnahanNetwork ManagerCommented:
Do you want it anything but "0"?

=IF((AND(D298<>0, E298<>0)),F297+D298+E298,0)

This will place a "0" only if either D298 or E298 is "0" or blank, otherwise will perform the calculation
Steven CarnahanNetwork ManagerCommented:
Wait,  working on an error.  This formula will do the calculation as long as there is a value not equal to "0" in both but not if there is a value in either.  

I think we are back to the OR instead of the AND.

=IF((OR(D298<>0, E298<>0)),F297+D298-E298,0)    (noticed I have been using a "+" instead of "-" in the last part of the calculation)

or again what Professorjimjam originally posted:


The second will nothing in the field where mine puts a "0"
100questionsAuthor Commented:
Thanks.  Nothing in the field ia the desired output if D and E have nothing in their fields simultaneously.
Steven CarnahanNetwork ManagerCommented:
Then I suggest you go with the first solution provided by Professorflimflam.
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 Excel

From novice to tech pro — start learning today.