# How to create two functions in the same excel field?

Dear all,

I am trying to create a small program on excel for my friend since he is on budget. He wants the TOTAL field to SUM or SUBTRACT from the previous AMOUNT.
I have created everything except the last field. I tried many times and google it a lot.
Please assist me #excel_expert.
###### 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.

Director, Information SystemsCommented:
"He wants the TOTAL field to SUM or SUBTRACT from the previous AMOUNT."
On what criteria does the calculation decide if it's going to sum or subtract?  Or are you saying PREVIOUS + TOTAL = RESULT, and if TOTAL is negative the operation should be subtraction?
0
ITAuthor Commented:
He wants the new total field to be like this:

New total = previous total - Amount IN OR previous total + Amount in

I did not find a way to put two functions together.
Any help would be appreciate.
0
Director, Information SystemsCommented:
It should only require one function:
NewTotal = PreviousTotal + AmountIn

Unless you have some other criteria that determines if AmountIn is positive or negative, just adding the two numbers together should do the trick.
0
ITAuthor Commented:
He wants the new total amount to be pre-configured like this : new total amount = previous amount - amount out OR previous total amount + amount IN.
As you can see the following screenshot.
EXCEL.JPG
Book1.xlsx
0
Director, Information SystemsCommented:
Looking at that .jpg, what's wrong with:
=E2+C3-D3
0
Excel & VBA ExpertCommented:
Try this...

In E2
``````=IF(C2&D2="","",SUM(E1,C2,-D2))
``````
and copy it down.
1

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.

ITAuthor Commented:
Thank you it is not difficult as I thought lol
0
Excel & VBA ExpertCommented:
You're welcome Sam!
Sometimes it is difficult to figure out the small logic. Lol
0
ITAuthor Commented:
Is there a helpful tutorial for excel functions pls?
0
Excel & VBA ExpertCommented:
If you Google it, you will find plenty of good stuff to begin with.
Here is one of the best YouTube channel "ExcelIsFun" having thousands of good videos.
0
ITAuthor Commented:
Thank you :)
0
Excel & VBA ExpertCommented:
You're welcome Sam!
0
Excel & VBA ExpertCommented:
Answered the original question.
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 Excel

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.