- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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!
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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:
- Get length of the name ->
Length(:name)
- Remove first character from the name ->
Substitute(:name, Left(:name, 1), "")
- Get length of the string where first character is removed ->
Length(previous part)
- And finally calculate difference between these two strings
Length(:name) - Length(Substitute(:name, Left(:name, 1), ""))
-Jarmo
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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:
- Get length of the name ->
Length(:name)
- Remove first character from the name ->
Substitute(:name, Left(:name, 1), "")
- Get length of the string where first character is removed ->
Length(previous part)
- And finally calculate difference between these two strings
Length(:name) - Length(Substitute(:name, Left(:name, 1), ""))
-Jarmo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How can count the number of characters in a cell?
Created:
Dec 28, 2020 07:04 AM
| Last Modified: Dec 28, 2020 4:05 AM
(2768 views)
| Posted in reply to message from jthi 12-28-2020
Clever! (And comment your code if you use this, the next person will appreciate explaining what you are doing!)
Craige