This example describes how to count the **number of words** in a **cell**.

1a. The TRIM function returns a string with leading spaces, extra spaces and trailing spaces removed.

This example describes how to count the **number of words** in a **cell**.

1a. The TRIM function returns a string with leading spaces, extra spaces and trailing spaces removed.

1b. To get the length of the string with normal spaces, we combine the LEN and TRIM function.

2a. The SUBSTITUTE function replaces existing text with new text in a text string. We use the SUBSTITUTE function to get the string without spaces.

2b. To get the length of the string without spaces, we combine the LEN and SUBSTITUTE function.

3. Now comes the simple trick. To get the number of words, we subtract the length of the string without spaces (10) from the length of the string with normal spaces (12) and add 1.

Hope this helps! Leave us a comment if this post helped you or if you have any questions.

]]>This example describes how to **count the number of instances of text (or a number) in a cell**.

1. Use the LEN function to get the length of the string (25 characters, including spaces).

2. The SUBSTITUTE function replaces existing text with new text in a string. LEN(SUBSTITUTE(A1,B1,””)) equals 13 (the length of the string without the words dog). If we subtract this number from 25, we get the length of the dog instances (25-13=12).

3. Dividing this number by the length of the word dog (3), gives us the dog instances (12/3=4).

Hope this helps! Leave a comment if this post helped you or in case of any questions.

]]>This example teaches you how to **separate strings** in **Excel**.

The problem we are dealing with is that we need to tell Excel where we want to separate the string. In case of Smith, Mike the comma is at position 6 while in case of Williams, Janet the comma is at position 9.

1. To get the first name, use the formula below.

Explanation: the FIND function finds the position of the comma. The LEN function returns the length of the string. =RIGHT(A2,LEN(A2)-FIND(“,”,A2)-1) reduces to =RIGHT(A2,11-6-1). =RIGHT(A2,4) extracts the 4 rightmost characters and gives the desired result (Mike).

2. To get the last name, use the following formula.

**Explanation**: the FIND function finds the position of the comma. =LEFT(A2,FIND(“,”, A2)-1) reduces to =LEFT(A2,6-1). =LEFT(A2,5) extracts the 5 leftmost characters and gives the desired result (Smith).

3. Select the range B2:C2 and drag it down.

Hope this helps! Leave a comment if this post helped you or in case of any questions.

]]>Join Strings | Left | Right | Mid | Len | Find | Substitute

**Excel** has many functions to offer when it comes to manipulating **text strings**.

To join strings, use the & operator.

Note: to insert a space, use ” ”

To extract the leftmost characters from a string, use the LEFT function.

To extract the rightmost characters from a string, use the RIGHT function.

To extract a substring, starting in the middle of a string, use the MID function.

Note: started at position 5 (p) with length 3.

To get the length of a string, use the LEN function.

Note: space (position 8) included!

To find the position of a substring in a string, use the FIND function.

Note: string “am” found at position 3.

To replace existing text with new text in a string, use the SUBSTITUTE function.

Hope this helps! Leave a comment if this post helped you or in case of any questions.

##### error | #NAME? error | #VALUE! error | #DIV/0! error | #REF! error | # IfError | # IsError | Aggregate | Circular reference | Floating Point Errors |

This chapter teaches you how to deal with some common **formula errors** in **Excel**.

When your cell contains this **error code**, the column isn’t wide enough to display the value.

1. Click on the right border of the column A header and increase the column width.

Tip: double click the right border of the column A header to automatically fit the widest entry in column A.

The #NAME? error occurs when Excel does not recognize text in a formula.

1. Simply correct SU to SUM.

Excel displays the #VALUE! error when a formula has the wrong type of argument.

1a. Change the value of cell A3 to a number.

1b. Use a function to ignore cells that contain text.

Excel displays the #DIV/0! error when a formula tries to divide a number by 0 or an empty cell.

1a. Change the value of cell A2 to a value that is not equal to 0.

1b. Prevent the error from being displayed by using the logical function IF.

**Explanation**: if cell A2 equals 0, an empty string (“”) is displayed. If not, the result of the formula A1/A2 is displayed.

Excel displays the #REF! error when a formula refers to a cell that is not valid.

1. Cell C1 references cell A1 and cell B1.

2. Delete column B. To achieve this, right click the column B header and click Delete.

3. Select cell B1. The reference to cell B1 is not valid anymore.

4. To fix this error, you can either delete +#REF! in the formula of cell B1 or you can undo your action by pressing CTRL + z

This example illustrates the **IFERROR function** in **Excel**.

1. For example, Excel displays the #DIV/0! error when a formula tries to divide a number by 0.

2. Use the IFERROR function. If a cell contains an error, an empty string (“”) is displayed.

This example illustrates the **ISERROR function** in **Excel**.

1. For example, Excel displays the #DIV/0! error when a formula tries to divide a number by 0.

The ISERROR function checks whether a value is an error and returns TRUE or FALSE.

2. Use the IF and the ISERROR function. If a cell contains an error, the value 5 is returned. If not, the value 100 is returned.

**Excel** functions such as SUM, COUNT, LARGE and MAX don’t work if a range includes errors. However, you can easily use the **AGGREGATE function** to fix this.

1. For example, Excel returns an error if you use the SUM function to sum a range with errors.

2. Use the AGGREGATE function to sum a range with errors.

**Explanation:** the first argument (9) tells Excel that you want to use the SUM function. The second argument (6) tells Excel that you want to ignore error values.

3. It’s not easy to remember which argument belongs to which function. Fortunately, the AutoComplete feature in Excel helps you with this.

4. The AGGREGATE function below finds the second largest number in a range with errors.

**Explanation:** the first argument (14) tells Excel that you want to use the LARGE function. The second argument (6) tells Excel that you want to ignore error values. The fourth argument (2) tells Excel that you want to find the second largest number.

5. The AGGREGATE function below finds the maximum value ignoring error values and hidden rows.

**Explanation:** the first argument (4) tells Excel that you want to use the MAX function. The second argument (7) tells Excel that you want to ignore error values and hidden rows. In this example, row 2 is hidden.

A formula in a cell that directly or indirectly refers to its own cell is called a **circular reference**. This is not possible.

1. For example, the formula in cell A3 below directly refers to its own cell. This is not possible.

Note: **Excel** returns a 0 if you accept this circular reference.

2a. For example, the formula in cell C2 below refers to cell C1.

2b. The formula in cell C3 refers to cell C2.

2c. The formula in cell C4 refers to cell C3.

2d. So far, everything’s OK. Now change the value in cell C1 to the formula =C4. Cell C1 refers to cell C4, cell C4 refers to cell C3, cell C3 refers to cell C2, and cell C2 refers to cell C1. In other words, the formula in cell C1 indirectly refers to its own cell. This is not possible.

Note: Excel returns a 0 if you accept this circular reference.

3. To find your circular references, on the Formulas tab, in the Formula Auditing group, click the down arrow next to Error Checking.

4. Click Circular References.

**Excel** stores and calculates floating point numbers. Sometimes, the result of a formula is a very close approximation.

1. For example, take a look at the formulas below. At first glance, everything looks alright.

Hope this helps! Leave a comment if this post helped you or in case of any questions.

The VLOOKUP (Vertical lookup) function looks for a value in the leftmost column of a table, and then returns a value in the same row from another column you specify.

1. Insert the VLOOKUP function shown below.

Explanation: the VLOOKUP function looks for the ID (104) in the leftmost column of the range $E$4:$G$7 and returns the value in the same row from the third column (third argument is set to 3). The fourth argument is set to FALSE to return an exact match or a #N/A error if not found.

2. Drag the VLOOKUP function in cell B2 down to cell B11.

Note: when we drag the VLOOKUP function down, the absolute reference ($E$4:$G$7) stays the same, while the relative reference (A2) changes to A3, A4, A5, etc.

In a similar way, you can use the HLOOKUP (Horizontal lookup) function.

The MATCH function returns the position of a value in a given range.

**Explanation:** Yellow found at position 3 in the range E4:E7. The third argument is optional. Set this argument to 0 to return the position of the value that is exactly equal to lookup_value (A2) or a #N/A error if not found.

The INDEX function below returns a specific value in a two-dimensional range.

Explanation: 92 found at the intersection of row 3 and column 2 in the range E4:F7.

The INDEX function below returns a specific value in a one-dimensional range.

Explanation: 97 found at position 3 in the range E4:E7.

The CHOOSE function returns a value from a list of values, based on a position number.

Explanation: Boat found at position 3.

Hope this helps! Leave a comment if this post helped you or in case of any questions.

]]>Ah! why not Nested IF? Anyone who’s spent time in Data Analysis especially in the area of Finance knows that using Nested IF would be a confusing and you may end up getting incorrect result also, it becomes complex. Combining IF with AND function can be a good way in keeping the formula simpler and easy to understand.

In this section, learn how to build an IF statement with AND. For example, if you are looking for a formula that will go into to cell C2 and, if the number is between 100 and 999 then the result will be 100 – otherwise, if it is outside that range then the result will be zero.

Example of how to use the formula:

Step 1: Put the number in cell C6 you want to test (150).

Step 2: Put the criteria in cells C8 and C9 (100 and 999).

Step 3: Put the results if true or false in cells C11 and C12 (100 and 0).

Step 4: type the formula =IF(AND(C6>=C8,C6<=C9),C11,C12)

Here is a screenshot in Excel after using the formula for an IF statement between two numbers. You can see the result from the example is 100 because the number 150 is between 100 and 999.

Bravo! you have now combined IF with AND between two numbers.

__Syntax of ABS function in Excel__

ABS(number)

__ABS function Example:__

Let say there are we want an absolute value for -10

=ABS(-10) will give 10

Let say there are three values -5,-10 and – 8 in A1, B1 and C1 respectively.

=ABS(A1*B1*C1) will give 400

]]>For E.g:-

You have a data with table as shown below, where you have dates and employee names listed as below and you wanted to merge both the cells Date and Name into a single cells referencing the headers.

Let see how we can Split a Single Cell diagonally in Excel

1. Right click on the cell where we want to put “Date” and “Name” and select the option Format cells from the drop-down.

2. Select a diagonal border you’d like to specify in the cell

3. Click “OK”

Set the cell’s Horizontal Alignment to “left” and vertical alignment to “center”.

4. Type in “Date” then Hit “Alt+Enter” which places the cursor in the second line of the cell. The type in “Name”.

5. Then use the space bar to push the “Date” to right to accomplish the task of Splitting a Cell Diagonally in Excel.

The Above tip is very important when you want to represent data in a tabular format.

Enjoy Excelling!

]]>__You can do it by two ways:__

1. Right click on the Ribbon and click on “Collapse the Ribbon”.

How to Hide a Ribbon in Excel-ExcelBlackbook.com

2. Use the Ctrl + F1 keyboard shortcut in Excel.

]]>