How to find and spill the positions of all occurrences of a specific character in a string?

Rnkhch

Well-known Member
Joined
Apr 28, 2018
Messages
528
Office Version
  1. 365
Platform
  1. Windows
Hello,

This question is related to the FIND or SEARCH functions, but both of these functions return the position of only the first occurrence of the specified character(s) in a string. But how can I get a spill of all positions if the specific character occurs more than once?

For example, in the attached XL2BB blow, how can I get the positions of all the commas in spill outputs? 😅 (I mean a separate spill for each of the examples)

Blank power workbook1
ABCD
112,34,A,63,98,D33
2C,43,B+,17,9922
345 , 33, A- ,17,88 , 12 ,3999
4
Sheet2
Cell Formulas
RangeFormula
B1:B3B1=FIND(",",A1)
C1:C3C1=SEARCH(",",A1)


Thanks for any input! 🤗
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi R,

To tell Excel's Find to return the 2nd occurrence the Start_num = 1st +1. the third - 2nd+1, etc
Then it knows where texactly to look for within the string.

G


Book1
ABCDEFGHIJ
11st2nd3rd4th5th6th7th
2Find
312,34,A,63,98,D33681114  
4C,43,B+,17,99225811   
545 , 33, A- ,17,88 , 12 ,39991830334051 
Sheet1
Cell Formulas
RangeFormula
D3:D5D3=IFERROR(FIND(",",$A3,1),"")
E3:J5E3=IFERROR(FIND(",",$A3,D3+1),"")
B3:B5B3=FIND(",",A3)
 
Upvote 0
Thank you, yes, I was aware of this. But I was wondering if there is a way to automatically get the entire positions in one spill, so that I can store the spill in a LET variable and then supply the spill as input into other functions in the LET.
 
Upvote 0
milestone.xlsx
ABCDEFGH
112,34,A,63,98,D3681114
2C,43,B+,17,9925811
345 , 33, A- ,17,88 , 12 ,3991830334051
4
Sheet3
Cell Formulas
RangeFormula
B1:F1,B3:G3,B2:E2B1=LET(s, SEQUENCE(1,LEN(A1)), n, (MID(A1,s,1)=",")*s, FILTER(n,n<>0))
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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