Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to find SECOND occurrence in a string?
I need a formula to find the position of the SECOND occurrence of a character
in a string. I can find the first occurrence using the FIND function no problem but I have no idea how to find the position of the second occurrence formulaically. Is there a formula to do that without running VBA? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to find SECOND occurrence in a string?
Try this:
A1 = abcdabc Find position of 2nd "a": =FIND("a",A1,FIND("a",A1)+1) Result = 5 Note that FIND is case sensitive. If you want to exclude case sensitivity replace FIND with SEARCH. Biff "Bill_S" wrote in message ... I need a formula to find the position of the SECOND occurrence of a character in a string. I can find the first occurrence using the FIND function no problem but I have no idea how to find the position of the second occurrence formulaically. Is there a formula to do that without running VBA? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to find SECOND occurrence in a string?
Say you have the word "supercalifragilistic" in Cell C6.
To find the second occurrence of the letter "a", you could use the formula: = FIND("a",C6,1) + FIND("a",MID(C6,FIND("a",C6,1)+1,LEN(C6)),1) which will return the value of '12'. Others may have a simpler formulas, however. / Tyla / On Mar 19, 10:08 am, Bill_S wrote: I need a formula to find the position of the SECOND occurrence of a character in a string. I can find the first occurrence using the FIND function no problem but I have no idea how to find the position of the second occurrence formulaically. Is there a formula to do that without running VBA? |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to find SECOND occurrence in a string?
Wow, beautiful solution, and so simple. I am often surprised at how some of
the best Excel solutions are the shortest. Thanks! "T. Valko" wrote: Try this: A1 = abcdabc Find position of 2nd "a": =FIND("a",A1,FIND("a",A1)+1) Result = 5 Note that FIND is case sensitive. If you want to exclude case sensitivity replace FIND with SEARCH. Biff "Bill_S" wrote in message ... I need a formula to find the position of the SECOND occurrence of a character in a string. I can find the first occurrence using the FIND function no problem but I have no idea how to find the position of the second occurrence formulaically. Is there a formula to do that without running VBA? |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to find SECOND occurrence in a string?
You're welcome. Thanks for the feedback!
Biff "Bill_S" wrote in message ... Wow, beautiful solution, and so simple. I am often surprised at how some of the best Excel solutions are the shortest. Thanks! "T. Valko" wrote: Try this: A1 = abcdabc Find position of 2nd "a": =FIND("a",A1,FIND("a",A1)+1) Result = 5 Note that FIND is case sensitive. If you want to exclude case sensitivity replace FIND with SEARCH. Biff "Bill_S" wrote in message ... I need a formula to find the position of the SECOND occurrence of a character in a string. I can find the first occurrence using the FIND function no problem but I have no idea how to find the position of the second occurrence formulaically. Is there a formula to do that without running VBA? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Most common occurrence of a string | Excel Worksheet Functions | |||
Index function to find nth occurrence | Excel Worksheet Functions | |||
Find Many String options in ONE String | Excel Worksheet Functions | |||
Find nth occurrence and replace with ":" | Excel Worksheet Functions | |||
find last occurrence | Excel Worksheet Functions |