New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

(If Then) Excel Formula

Formulas, Functions, Formatting, Charts, Data Analysis, etc.

(If Then) Excel Formula

Postby bearman » Tue Dec 13, 2011 12:00 am

I need help writing an (If then) excel formula (Example)
E2 F2 G2
Payment Deposit Balance
$10.00 $100.00 $90.00 G2=F2-E2
$10.00 $80.00 G2+F3-E3
$100.00 $180.00 G3+F4-E4
If there is no entry in both E5 and F5 I would like G5 to show 0 or no entry instead of $180.00 all the way down the page.
  • 0

bearman
Rookie
 
Posts: 6
Joined: Dec 12, 2011
Reputation: 0

Re: (If Then) Excel Formula

Postby Sisyphus » Tue Dec 13, 2011 2:42 am

How is this?
Code: Select all
=IF(AND((E5=""),(F5="")),"",G3+F4-E4)


The IF Funktion has 3 Parts: IF ( Condition[s] , Result IF True , Result IF False ).
in the above formula the conditions are packaged in an AND Funktion. This function has two arguments (could have more), separated from each other by commas:
AND ( Arg1 , Arg2 )
in plain language: If Argument 1 is True AND Argument 2 is True Then the result of the AND function is True.

Now, the IF function will write "" (nothing) in the cell if both, E5 and F5 are empty. If you want a Zero instead, replace "" with 0. "" will cause a problem if you want to refer to the cell in further calculations and expect a number. You can hide zeros from Tools/Options so that zero can give you the same appearance as "".

I'm not sure about the True part of the formula. If G3+F4-E4 isn't correct, change it for any formula you like better.

Have a great day!
:D
  • 0

Have a great day! :D

Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)
Sisyphus
Former Moderator
 
Posts: 4454
Joined: Dec 7, 2011
Location: Shanghai
Reputation: 203
Excel Version: 2010

Re: (If Then) Excel Formula

Postby bearman » Tue Dec 13, 2011 11:52 am

Thank you so much. That worked great! I need to really get up to speed on figuring formulas, for making charts grafts ect. I do it for personal enjoyment loving to analyze things, however enjoyment can become frustration. It takes me hours to figure out little things and I do, because I know it can be done. Are there any great resources out there to help someone aquire a comprehensive knowledge and skill starting from zero. Again thank you so much. Seeing that formula work was so cool. :D
  • 0

bearman
Rookie
 
Posts: 6
Joined: Dec 12, 2011
Reputation: 0

Re: (If Then) Excel Formula

Postby Don » Tue Dec 13, 2011 12:00 pm

There are tons of great resources on the web. You can search youtube for a ton of free tutorials on Excel.

One channel that was affiliated with the previous forum is: http://www.youtube.com/user/excelishell

If you want a more structured approach with downloadable files with the video tutorials, you can check out this site, sometimes we run deals with them (monthly fee): http://www.teachmsoffice.com/


Aside from that, just searching the web will provide you with more information that you probably know what to do with as far as Excel goes lol.
  • 0

Don
Moderator
 
Posts: 733
Joined: Dec 4, 2011
Reputation: 2
Excel Version: 2010

Re: (If Then) Excel Formula

Postby bearman » Tue Dec 13, 2011 12:05 pm

Thank you so much Don.
  • 0

bearman
Rookie
 
Posts: 6
Joined: Dec 12, 2011
Reputation: 0


Return to General Excel Questions

Who is online

Users browsing this forum: Google [Bot] and 244 guests

cron