Sunday 16 June 2019

Mid Function


Description: A built-in, string/text function in excel that can be used as a worksheet function and VBA function.
*worksheet function can be used as a part of formula in excel. VBA functions are used in macro code that are entered through the Microsoft Visual Basic Editor.
Syntax: =MID(text, starting_num, num_of_chars)
Arguments:
  • text is the original text string
  • start_num is the position of the first character to extract
  • num_of_characters –No of characters to extract (mandatory in WS function and optional in VBA coding)

Purpose: To extract text/ substring from inside a string
Return: A substring/text value
Note:
  • Use the MID function when need to extract text from inside a text string, based on location and length.
  • Use FIND or SEARCH to locate starting_num when don't know the location in advance.

A few points that one should consider while using Mid Function in Excel (click on the Image to understand)
MID Function
MID Function


No comments:

Post a Comment