Home |
Search |
Today's Posts |
#1
|
|||
|
|||
count number of occurences within a string
Hello,
I want to count the number of "-" within a string like for instance "abc-klm-xyz". There are two "-" characters. Is must be a function that I don't know of. Any suggestions? Thanks in advance Gabriel |
#2
|
|||
|
|||
=SUMPRODUCT(--(ISNUMBER(SEARCH("-",MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))))) Hope this helps! Gabriel Wrote: Hello, I want to count the number of "-" within a string like for instance "abc-klm-xyz". There are two "-" characters. Is must be a function that I don't know of. Any suggestions? Thanks in advance Gabriel -- Domenic ------------------------------------------------------------------------ Domenic's Profile: http://www.excelforum.com/member.php...o&userid=10785 View this thread: http://www.excelforum.com/showthread...hreadid=320408 |
#3
|
|||
|
|||
Domenic Wrote: =SUMPRODUCT(--(ISNUMBER(SEARCH("-",MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))))) Hope this helps! Or the much simpler... =LEN(A1)-LEN(SUBSTITUTE(A1,"-","")) -- Domenic ------------------------------------------------------------------------ Domenic's Profile: http://www.excelforum.com/member.php...o&userid=10785 View this thread: http://www.excelforum.com/showthread...hreadid=320408 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count the number of worksheets in a workbook | Excel Discussion (Misc queries) | |||
Count number of shaded cells | Excel Discussion (Misc queries) | |||
Count the number of words in a cell! | Excel Worksheet Functions | |||
Count occurences between dates | Excel Worksheet Functions | |||
how to count the nr of occurrences of a text string in a cell rang | Excel Worksheet Functions |