BrainDump
  Home arrow BrainDump arrow Page 4 - Advanced String Manipulation Using MS Exce...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

Advanced String Manipulation Using MS Excel
By: Codex-M
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2009-06-10

    Table of Contents:
  • Advanced String Manipulation Using MS Excel
  • The MID Function in MS Excel
  • The FIND Function in MS Excel
  • The LEN function in MS Excel

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Advanced String Manipulation Using MS Excel - The LEN function in MS Excel


    (Page 4 of 4 )

    The LEN function is probably the simplest of all text-related functions. Its job is to simply count the number of characters inside the cell, even SPACES! So be careful; do not rely on the LEN function to count only characters. I highly recommend using the LEN function mixed with other string-cleaning functions. This is to ensure that your string manipulations are correct.

    For example if you have something like:

    Beautiful women

    placed in Cell A1, it comprises 15 characters. But if there are spaces before or after any words, your result with LEN will be more than 15 characters.

    To clean the text to be analyzed, it is recommended to use this set of functions:

    =trim(clean(A1))

    The job of this function is to remove any spaces as well as non-printable characters. Finally the LEN function (including the cleaning formulas) will be:

    =LEN(trim(clean(A1)))

    To use this one in the actual Excel spreadsheet, we will use our first example in this article:

    Instead of using:

    =MID(A1,5,1000)

    =MID(A2,5,1000)

    =MID(A3,5,1000)

    You can have:

    =MID(A1,5,LEN(TRIM(CLEAN(A1))))

    =MID(A2,5,LEN(TRIM(CLEAN(A2))))

    =MID(A3,5,LEN(TRIM(CLEAN(A3))))

    This can accurately count the number of characters, instead of using 1000 as the default value, and still produce the same results. Note that the LEN function is very versatile; it can be used along with FIND, MID and other text-related functions, as shown in the examples in this article.

    Summary

    We have successfully illustrated how to use the MID, FIND and LEN functions. These are very important Excel functions for conducting advanced text manipulations. You can start varying the example above and incorporate it into your daily work. As soon as you start acquiring these skills, they will help you to tremendously improve your office and analytical productivity using MS Excel.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    BRAINDUMP ARTICLES

    - Introduction to Office Live Workspace
    - Using MS Excel for One-way Analysis of Varia...
    - Comparing Data Sets Using Statistical Analys...
    - Import Blogger Posts into WordPress Using Wi...
    - Download WordPress from an FTP Server and Ru...
    - Install and Run WordPress in XAMPP Local Host
    - What Windows 7 Brings to the Table
    - Virtualization and Sandbox Detection
    - Advanced Firebug Techniques in Windows XP Ho...
    - Editing CSS with Firebug in Windows XP Home
    - Using Firebug in Windows XP Home
    - Migrating to Exchange Server 2007
    - Using System Restore on a Non-Bootable PC
    - Finding Logged on Users and More Scripting S...
    - Developing Macro Commands in MS Excel





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek