Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Excel Magic Trick 289: LEN & SUBSTITUTE functions Counting Tricks

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,172
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 16, 2009

Count Words Separated by Commas with LEN & SUBSTITUTE functions in a formula. Using LEN and SUBSTITUTE we can count the commas in "rad,cool, super" and get two then add one more to get three. This trick is useful because it can help us to count words, numbers or fields in a text string.

This trick is the basis for many other Tricks with Excel Formulas that analyze text strings.

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (3)

Sign In or Sign Up now to post a comment!
  • Search for and watch this video title:

    excelisfun Search & Find Excel Videos, Playlists, Download Excel Workbooks

  • kindly give me above worksheet in Excel.

  • Dear dukeofscouts,

    The logic of all these tricks is to find some pattern to exploit. We found commas as our pattern.

    The 5 numbers that are not zero are: 5 and 658 and 9 87 and 1.

    To count the individual characters that are numbers, use this:

    LEN(SUBSTITUTE(SUBSTITUTE(B19,­",0",""),",","")

    What are you trying to accomplish with the AND and SUBSTITUTE?

    --excelsifun

  • How was the last count 5? I count 8 numbers.

    Also can you use the AND function with a substitute?

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more