MID Function (VisioShapeSheet)

Office 2013 and later

Last modified: March 09, 2015

Applies to: Office 2013 | Visio 2013

In this article
Syntax
Remarks
Example

Returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify.

MID (text, start_num, num_chars)

Parameters

Name

Required/Optional

Data Type

Description

text

Required

String

The text string that contains the characters you want to extract.

start_num

Required

Number

The position of the first character you want to extract. The first character in the text string is position 1.

num_chars

Required

Number

The number of characters to return.

Return Value

String

If start_num is:

  • Greater than the length of text, MID returns "" (empty text).

  • Less than the length of text, but start_num plus num_chars exceeds the length of text, MID returns the characters up to the end of text.

  • Less than 1, MID returns the #VALUE! error value.

If num_chars is negative, MID returns the #VALUE! error value.

MID ("SSN 999-99-9999",5,11)

Returns 999-99-9999.

Show: