Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Character count
Is there a formula that returns a count of a specified character?
For example: Cell(A1) = I:\1stFolder\2ndFolder\3thFolder\4thFolder\5thFold er\abc.xls Answer would be 6 for "\" And also a formula that returns a folder name between 2 consecutive "\" |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Character count
To get a count of the number of times "\" appears:
=LEN(A1)-LEN(SUBSTITUTE(A1,"\","")) Which folder name do you want? There are 5 folders. Regards, Paul -- "dan" wrote in message news:97QKi.4076$WT2.3028@trndny05... Is there a formula that returns a count of a specified character? For example: Cell(A1) = I:\1stFolder\2ndFolder\3thFolder\4thFolder\5thFold er\abc.xls Answer would be 6 for "\" And also a formula that returns a folder name between 2 consecutive "\" |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Character count
say a1 has the full text and a2 has the character to be counted:
=LEN(A1)-LEN(SUBSTITUTE(A1,A2,"")) For the data between \ use Text to Columns -- Gary''s Student - gsnu200747 "dan" wrote: Is there a formula that returns a count of a specified character? For example: Cell(A1) = I:\1stFolder\2ndFolder\3thFolder\4thFolder\5thFold er\abc.xls Answer would be 6 for "\" And also a formula that returns a folder name between 2 consecutive "\" |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Character count
Try DataText To Columns for the second part.
-- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "dan" wrote in message news:97QKi.4076$WT2.3028@trndny05... Is there a formula that returns a count of a specified character? For example: Cell(A1) = I:\1stFolder\2ndFolder\3thFolder\4thFolder\5thFold er\abc.xls Answer would be 6 for "\" And also a formula that returns a folder name between 2 consecutive "\" |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Character count
Is there a formula that returns a count of a specified character?
For example: Cell(A1) = I:\1stFolder\2ndFolder\3thFolder\4thFolder\5thFold er\abc.xls Answer would be 6 for "\" And also a formula that returns a folder name between 2 consecutive "\" For the second question, if you really need a formula (that is, if Bob's TextToColumn suggestion isn't usable for some reason), then give this a try... =IF(AND(B10,B1<LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))),MID(LEFT(A1,FIND("*",S UBSTITUTE(A1&"\","\","*",B1+1))-1),1+FIND("*",SUBSTITUTE(A1,"\","*",B1)),260),"") It assumes the folder number you are looking for (1 for the the first folder, 2 for the second one, etc.) is in B1. The formula returns the empty string if zero, a negative value or a value that would take you up to (or beyond) the file name itself. Rick |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Character count
Hi,
If you are looking to count repetitions of a word (more than one character) for example the word "Folder" in your text string then you should change the Gary's formula to: =(LEN(A1)-LEN(SUBSTITUTE(A1,A2,"")))/LEN(A2) Thanks, -- Farhad Hodjat "Gary''s Student" wrote: say a1 has the full text and a2 has the character to be counted: =LEN(A1)-LEN(SUBSTITUTE(A1,A2,"")) For the data between \ use Text to Columns -- Gary''s Student - gsnu200747 "dan" wrote: Is there a formula that returns a count of a specified character? For example: Cell(A1) = I:\1stFolder\2ndFolder\3thFolder\4thFolder\5thFold er\abc.xls Answer would be 6 for "\" And also a formula that returns a folder name between 2 consecutive "\" |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Character count
Hi Rick,
Your formula is very useful to me. Thank you very much. "Rick Rothstein (MVP - VB)" wrote in message ... Is there a formula that returns a count of a specified character? For example: Cell(A1) = I:\1stFolder\2ndFolder\3thFolder\4thFolder\5thFold er\abc.xls Answer would be 6 for "\" And also a formula that returns a folder name between 2 consecutive "\" For the second question, if you really need a formula (that is, if Bob's TextToColumn suggestion isn't usable for some reason), then give this a try... =IF(AND(B10,B1<LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))),MID(LEFT(A1,FIND("*",S UBSTITUTE(A1&"\","\","*",B1+1))-1),1+FIND("*",SUBSTITUTE(A1,"\","*",B1)),260),"") It assumes the folder number you are looking for (1 for the the first folder, 2 for the second one, etc.) is in B1. The formula returns the empty string if zero, a negative value or a value that would take you up to (or beyond) the file name itself. Rick |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
Character count
Thank you, Farhad,
I like its thoroughness "Farhad" wrote in message ... Hi, If you are looking to count repetitions of a word (more than one character) for example the word "Folder" in your text string then you should change the Gary's formula to: =(LEN(A1)-LEN(SUBSTITUTE(A1,A2,"")))/LEN(A2) Thanks, -- Farhad Hodjat "Gary''s Student" wrote: say a1 has the full text and a2 has the character to be counted: =LEN(A1)-LEN(SUBSTITUTE(A1,A2,"")) For the data between \ use Text to Columns -- Gary''s Student - gsnu200747 "dan" wrote: Is there a formula that returns a count of a specified character? For example: Cell(A1) = I:\1stFolder\2ndFolder\3thFolder\4thFolder\5thFold er\abc.xls Answer would be 6 for "\" And also a formula that returns a folder name between 2 consecutive "\" |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
Character count
Very nice, Thank you
"PCLIVE" wrote in message ... To get a count of the number of times "\" appears: =LEN(A1)-LEN(SUBSTITUTE(A1,"\","")) Which folder name do you want? There are 5 folders. Regards, Paul -- "dan" wrote in message news:97QKi.4076$WT2.3028@trndny05... Is there a formula that returns a count of a specified character? For example: Cell(A1) = I:\1stFolder\2ndFolder\3thFolder\4thFolder\5thFold er\abc.xls Answer would be 6 for "\" And also a formula that returns a folder name between 2 consecutive "\" |
#10
Posted to microsoft.public.excel.misc
|
|||
|
|||
Character count
Thank you
"Gary''s Student" wrote in message ... say a1 has the full text and a2 has the character to be counted: =LEN(A1)-LEN(SUBSTITUTE(A1,A2,"")) For the data between \ use Text to Columns -- Gary''s Student - gsnu200747 "dan" wrote: Is there a formula that returns a count of a specified character? For example: Cell(A1) = I:\1stFolder\2ndFolder\3thFolder\4thFolder\5thFold er\abc.xls Answer would be 6 for "\" And also a formula that returns a folder name between 2 consecutive "\" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
character count | New Users to Excel | |||
Character count within a cell | Setting up and Configuration of Excel | |||
How do i set up a character count for a specified cell?? | Excel Discussion (Misc queries) | |||
how can I count (countif) the character: * | Excel Worksheet Functions | |||
Character Count | Excel Worksheet Functions |