Remove characters from a string using LEFT and RIGHT - Fix your data! (Excel tips #3)

preview_player
Показать описание

#excel #exceltips #exceltutorial #exceltricks #exceltipsandtricks

Follow me on other media:

Music used:

Annotations:

Often times, data is delivered in unworkable
formats.

For instance, this financial data is a string (data
type), has dollar signs and a decimal number
too much.

This means that you can't add, substract, sum
or average these numbers.

The sum function returns 0.

Let's fix this data!

Select a cell and type: RIGHT(B2;6) and press
'Enter'.

This function takes the 6 characters from right
from cell B2. The dollar sign is the 7th character
from the right, and is now gone in cell D2.

Drag cell D2 down by the corner to repeat the
formula in the cells below.

To remove a character from the left, type
LEFT(D2;5), and press ENTER.

This function takes the 5 characters from cell D2
from the left, which gets rid of the last decimal.
(NOTE: this is not the same as rounding!)

Drag cell F2 down by the corner to repeat the
formula in the cells below.

Finally, copy the new column of data, and paste
them as Values, to get rid of the formulas you
used to create the values in column F.

Hover over the '!' and click 'Convert to Number'.

You can now use this data as a number, and for
instance, calculate the sum.

To add the dollar signs back in, but keep the
data as numbers, select the data, right-click,
and click 'Format Cells...'

Click the 'Number'-tab, and select 'Currency'.

Find, and click on "$ English (U.S.)" in the drop-
down menu, and click 'OK'.

You can now remove the column with the old
data and the RIGHT and LEFT formula colums.

All done!
Рекомендации по теме
Комментарии
Автор

This problem is for a Mac Excel. With the numbers below say every "6" is highlighted. The first "6" to be found would be included in "360". What would be the formula to find the number to the left (3), the right (0) the top (2) and the bottom (0). The "360" is actually in three separate columns but can be concatenated to appear in one. The problem I am having is having Excel recognize the highlighted "6" and then perform the function of finding the number to the left, right, top and bottom. Understand that at times there may not be a number to the left or right depending on the location of the "6". Do you have any suggestions? Any aid would certainly be appreciated.

542
188
724
360
906
542
188
724
360
906

Entrepreneur-jxll
Автор

FYI on Mac Excel use a comma instead of semi-colon

JeffChabot