ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   string.matchPattern ??? (https://www.excelbanter.com/excel-programming/371462-string-matchpattern.html)

drofluga

string.matchPattern ???
 
Hi there,

i tried to find a function where i can check if there are two or eight
blanks in front of a string. How is this possible?

Best regards,
drofluga


Tom Ogilvy

string.matchPattern ???
 
if all the blanks will be on the left side this will give you the count
=len(A1)-len(substitute,A1," "))

If only two or 8 and it has to be one or the other

=if(mid(a1,3,1)=" ",8,2)

or tell us more

--
Regards,
Tom Ogilvy



"drofluga" wrote:

Hi there,

i tried to find a function where i can check if there are two or eight
blanks in front of a string. How is this possible?

Best regards,
drofluga



drofluga

string.matchPattern ???
 
Thanks for the hint. It worked!

Greetings
;-)

Tom Ogilvy schrieb:

if all the blanks will be on the left side this will give you the count
=len(A1)-len(substitute,A1," "))

If only two or 8 and it has to be one or the other

=if(mid(a1,3,1)=" ",8,2)

or tell us more

--
Regards,
Tom Ogilvy



"drofluga" wrote:

Hi there,

i tried to find a function where i can check if there are two or eight
blanks in front of a string. How is this possible?

Best regards,
drofluga





All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com