Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions > Text > MID

 

MID(text, start_num, num_chars)

 
 Returns the text string which is a substring of the given string.

 textThe text string containing the characters you want to extract.
 start_numThe position of the first character you want to extract in text.
 num_charsThe number of characters you want to return.

 REMARKS
 
  • If "num_chars" < 0, then #VALUE! is returned.
     
  • The first character in text has "start_num" 1, and so on.
     
  • There is also a MIDB() function which can be used with languages that use the double-byte character set.

     EXAMPLES
     
     A
    1=MID("this is some text",9,4) = some
    2=MID("this is some text",1,1) = t
    3=MID("this is some text",2,1) = h
    4=MID("this is some text",1,2) = th
    5=MID("Fluid Flow",1,5) = Fluid
    6=MID("Fluid Flow",7,20) = Flow
    7=MID("some more text",-3,2) = #VALUE!
     

     Functions - M | Index - M | Text Manipulation | Office Online 

     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.Top