Showing posts with label Text Function. Show all posts
Showing posts with label Text Function. Show all posts

Thursday, February 27, 2014

TRIM Function

When you import data from other programs it often comes with additional spaces - at the beginning, at the end or even between words. Luckily for us TRIM function will remove the excess spaces from text, except for single spaces between words.

How to use the TRIM function

Example of using the TRIM function
The image below shows using TRIM function in column B and the result of using the TRIM function in column C.

 Other examples of TRIM Function:

Friday, February 21, 2014

How to highlight cells with extra spaces (using conditional formatting).

The data entry process involves the possibility of incorrect information input - we're all human and can make mistakes. One such option - extra spaces. Someone puts their by chance, someone - even intentionally. But in any case, even an extra space will be a problem for you at a later time during the entered information.
Additional "charm” that they have not seen, though, if you really want it, can be made visible by using a macro.
How do we avoid this - highlight incorrectly entered data directly in the process of data entry, rapidly signaling an error to the user.
To do this, use the Conditional Formatting:
1. Select the cells where we need to check extra spaces.
2. From the Home tab, click Conditional Formatting - New Rule.
3. Select the type of the rule right to use a formula to determine the formatted cells  and type in the following formula:
=TRIM(A1)<>A1



The TRIM function removes extra spaces from text. If the original contents of the current cell are not "trimmed" by using the TRIM function, then in the cell have extra spaces. Then fill a color input fields that can be selected by clicking on Format (Format).
And here is the result: