cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
lala
Level IX

How can count the number of characters in a cell?

For example, how to count the number of line names with the first character of the name?

Thanks!

2020-12-28_16-32-43.png

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How can count the number of characters in a cell?

If I understand correctly what you want to do (calculate character count for the first character in name) you could do it with something like this:

  1. Get length of the name -> Length(:name)
  2. Remove first character from the name -> Substitute(:name, Left(:name, 1), "")
  3. Get length of the string where first character is removed -> Length(previous part)
  4. And finally calculate difference between these two strings

 

Length(:name) - Length(Substitute(:name, Left(:name, 1), ""))

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: How can count the number of characters in a cell?

If I understand correctly what you want to do (calculate character count for the first character in name) you could do it with something like this:

  1. Get length of the name -> Length(:name)
  2. Remove first character from the name -> Substitute(:name, Left(:name, 1), "")
  3. Get length of the string where first character is removed -> Length(previous part)
  4. And finally calculate difference between these two strings

 

Length(:name) - Length(Substitute(:name, Left(:name, 1), ""))

 

-Jarmo
Craige_Hales
Super User

Re: How can count the number of characters in a cell?

Clever! (And comment your code if you use this, the next person will appreciate explaining what you are doing!)

Craige

Recommended Articles