Saturday, 20 August 2011

1. A Very Simple IF Statement

IF, excuse the pun, you work in Finance or even with Excel everyday...... YOU SHOULD KNOW THIS!!!
Really, i mean it.

The “IF” Statement is one of the most used Functions in Excel used in the Business / Finance world. 

This is ideal if you work with large reports or lists, and need further information by categorizing each row of information further.
I'll say this now, you can use "IF" Statements to a large degree of complexity! But for now we'll stay simple.

The Structure

Looks like this:

1. "Logical Test" - this is where you define your logic. Like X is greater than 0 or Y is equal to a certain number or word.
2. "Value if True" - what you want the formula to output if the logic is TRUE.
3. "Value if False" - what you want the formula to output if the logic is FALSE.

So basically Excel is saying...
  1. What's the logic?
  2. What do you want me to do each time that logic is TRUE?
  3. What do you want me to do each time taht logic is FALSE?
Thats it! OK so lets have a look at an example, whats a tutorial without one?!!? Yeah but this is different, this example might look like something YOU ALREADY WORK WITH!! No Apples or Pears or bloody Shoe Sales!!!

Some Account Codes and Balances. YEY!


Right, you can use an "IF" Statement here to start defining what the Account Codes mean. Lets face it, the higher up management types dont know that!! You do!! But we gotta make it simple for them. And here we go!


Lets insert a Column between C and D, and Call it "Acct Desc". Great.
Now in Cell D2, we'll make our Simple "IF" Statement. One step at a time soldier! Lets assume that Object number 11221 is Accounts Payable


Start up the IF Statement
  1. Hit the fx button which is to the left of the Formula Bar (the one that brings up the list of formulas!)
  2. Find IF and hit OK
Logic Test
  1. What's the logic? Object 11221 is Accounts Payable. So the logic test is 11221 = "Accounts Payable". 
  2. So you need the "IF" Statement to identify each line that has 11221 under the Object column, in order to apply this logic.
  3. Therefore the Logic Test is B2=11221
  4. Remember that the next parts are where you tell it what to do if this is TRUE or FALSE.
Value if TRUE
  1. What do you want it to do if the logic is True? Well we said that 11221 is Accounts Payable, so lets get it to say "Accounts Payable".
  2. Quite simply "Accounts Payable"

Value if FALSE
  1. What do you want it to do if the logic is True? We dont know let, and you dont have to!
  2. Either leave it blank or enter a 0.
  3. For those lines where the Object is NOT 11221, we will see "FALSE" or 0 respectively.
Almost done! Just copy what you've done to the bottom of the data. If you dont, then its not going to apply anything to your report!!!


And that's a Simple IF Statement.


All this is a bit pointless if you don't mess around with this yourself.
Try doing this:
  1. Get the formula to say "Unknown" if the logic is FALSE.
  2. Let's say Legal Entity 801 is Spain, change the formula to output "Spain" based on the Legal Entity instead of Object.
All da best!

No comments:

Post a Comment