Office 2010 - Excel

Lesson 42: Some more Functions(2)

42/87 Lessons 

“LEFT” /” RIGHT”

The “LEFT” function returns the (the) first character (s) in a string.

For example:

We have typed ‘Peter the hero’ in cell A1 .

Next we want the first name to appear in cell A2, so in order to separate the string in cell A1 we type =LEFT(A1,5)

The first argument in the function in the reference to cell A1.
The second argument in our function is the number of characters 5.

The result in cell 2 appears as “Peter”.

The “RIGHT” function works the same except that we start counting from the right.

For example:

We still have ‘Peter the hero’ in cell A1.

We now type =RIGHT (A1,4)

The result is “hero”

 

Note1:

A space is considered a character by Excel

Note 2:

When you change the data in cell A1, the cell contents will automatically be adjusted in cell A2. If you want the cell contents of cell A2 to remain the same, you can “Copy” the cell and use “Paste special”, choosing “Values”. This way, only the value of the cell content will be preserved, not the “Formula”.

Right-click the cell where you want to paste it, and select “Values” from the pop-up menu.

 

“TRIM”

In the “TRIM” function, we delete the spaces before and after the text in our cell, NOT in the text. W use this function to align text with irregular spacing.

 

As an example, this function removes spaces in cells B5 and B7 (before and after the customer name), but not IN the customer name in cells A4 and A7

Note1:

Please note that if you want to adjust the data in column A and the formulas in column B, first copy and paste only “valu from column B, as explained earlier.

 

“IF”

The IF function returns a value if a condition is met, and another value when the condition is not met.
In the example and image below we apply the IF function to report whether a student has passed or failed.

Below follows an explanation of the formula:

As always, we begin our “Formula” with an equal sign, followed by the IF function and by opening the parenthesis.
We need to know whether the total of the points obtained is greater than half of the total points that can be obtained.
So cell E4 (total points scored) needs to be larger than 15 or “>15” because 15 is half of the total points (30) which can be scored. If this condition is true, we ask “Excel” to display the value “pass”, if this is not true, we want “Excel” to display the value “failed”.  We finish the “Formula” with the closing parenthesis, and click Enter.
Between the two arguments, you type a comma(,) and the text in a “Formula” is always in quotation marks (“Passed” or “Failed”)

 

Awesome!
You've completed Lesson 42
START NEXT LESSON