Count Blank

saurabh726

Well-known Member
Joined
Dec 13, 2003
Messages
891
Hi

Is there any formula by which i can count how many blank spaces are there before a text string in a single cell

For ex

help
figure

So if i wanna know how many blank spaces are there before help in single cell and how many blank spaces are there before figure in single cell how do i do that.??

Saurabh
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi Saurabh:

It is not clear from your description what you are trying to accomplish. In the example that you have given in your post, can you elaborate what you are getting at, and what you think is the correct answer -- and then let us take it from there.
 
Upvote 0
Book7
ABCD
1help3
2figure2
3helpfile2
4saturn#N/A
5vtacdzxsa1
6
Sheet1


The formula in B1 is:

=MATCH(" ",MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))

which must be confirmed with control+shift+enter instead of just with enter.

An #N/A result means no leading space.
 
Upvote 0
Hi Aladin:

You are right -- my formulation assumed only leading spaces (what the OP called 'before the word')!
 
Upvote 0
Yogi Anand said:
Hi Aladin:

You are right -- my formulation assumed only leading spaces (what the OP called 'before the word')!

You seem to miss the point. OP might not realize the point which motivates Jon's question, I'd expect that you should. If you didn't, you might have realized it after the formula I posted.
 
Upvote 0
Thanx A LOT YOGI AND jUST_jon

well both the fomulas are working if i edit the text string they dont work orginally

i have exported this file from a html which is based on java script does that makes any difference or something else..coz if i edit this string manually i mean spaces they work otherwise they are not working.

Please suggest what exactly the problem can be

Saurabh
 
Upvote 0

Forum statistics

Threads
1,225,138
Messages
6,183,089
Members
453,147
Latest member
Bree2019

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