Text data cleaning

Mashtonsmith1

New Member
Joined
May 16, 2020
Messages
30
Office Version
  1. 365
Platform
  1. Windows
Hello,

I need to run two tests on text fields ideally using one formuale.

The first test need to look for 2 consecutive spaces. (e.g. WORD__WORD) as opposed to just 1 space between words.

The second test then needs to look for 1 or more spaces AFTER the last entry. (e.g WORD_WORD_) or (WORD_WORD__)

Entries are of various lengths.

Can I do this with an IF formula? Ideally the resultant cell shows either "Double space" or "Spaces at end" or both.

I dont want to TRIM or cleanse this just yet - just identify where these tests are true.

Thank you
 
Last edited:

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Here is one way (for an entry in cell A1):
Excel Formula:
=IF(AND(ISNUMBER(FIND("  ",A1)),RIGHT(A1,1)=" "),"Both",IF(ISNUMBER(FIND("  ",A1)),"Double Space",IF(RIGHT(A1,1)=" ","Spaces at end","None")))
If you don't want the word "None" if neither condition is met, just change "None" to "".
 
Upvote 0
Solution
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top