Need Help in counting + sign in a cell

  • Thread starter Thread starter kousanee
  • Start date Start date
K

kousanee

I am entering the following in a cell: =5+8+60+1

Now I would like to do two things:
1. I would like to count number of numerical terms in this entry
(e.g. 4 in the above example). Is there any way of counting + sign in
cell and showing the result in a different cell?

2. I would like to see the content of the above cell as is (i.e.,
=5+8+60+1) in another cell of a different worksheet of a workbook.

-Peter
 
This small UDF will return the number of plus signs in a formula:

Function count_plus(r As Range) As Integer
v = r.Formula
count_plus = Len(v) - Len(Replace(v, "+", ""))
End Function

This small UDF will display a function as a string:

Function formularity(r As Range) As String
formularity = r.Formula
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top