Count Number Of Braces/<> In Excel

The post demonstrated how we could count number of braces “<>” in Excel.

I have personally seen people HTML developers struggling to perform tasks in excel that involves “<>” symbol.

We will use two simple formula in excel called LEN and SUBSTITUTE to count the pair of <>.

As shown below we have HTML code in the cell A2 and we want to count number of <> symbol

Capture

Step 1




Enter the below formula in the cell B2

=(LEN(A2)-LEN(SUBSTITUTE(SUBSTITUTE(A2,”<“,””),”>”,””)))/2

Capture

So this formula works on counting the combination of “>” for each open “<” symbol.

Capture

Hope this helped.

Share The Knowledge

Random Posts

Leave a Reply