MID and MIDB functions to cut strings in Excel

In the previous articles, I introduced you to LEFT () and RIGHT () to cut the string to the left and right of the text. In this article, I will introduce to you the MID (), MIDB () functions to cut the string from the position you want to start cutting the string.

MID and MIDB functions to cut strings in Excel Picture 1

The article describes the syntax and usage of MID () and MIDB () functions to cut strings in Excel.

Description

The MID () function returns a string from a text string, with the position to start extracting from the text string and the number of characters returned by the string that is specified. Functions used in languages ​​use a single-byte character set (SBCS) and always count each character as 1.

The MIDB () function returns a string from a text string with the start of extraction and the specified number of bytes returned. The function counts each double-byte character as 2 when the default language is one of the languages ​​that supports DBCS.

Syntax

= MID (text, start_num, num_chars)

= MIDB (text, start_num, num_bytes)

Inside:

- text: is the text string you want to extract the substring.

- start_num: is the starting position to extract characters from the text string, calculated from the left to (the first character in the text string is 1, the second character is 2 .).

- num_chars: the number of characters you want to extract from the text string.

- num_bytes: the number of bytes you want to extract from the text string.

Note

- If start_num is less than 1, the function returns the #VALUE! Error value.

- If start_num is greater than the length of the text string, the function returns the empty string.

- Start_num is smaller than the text length, but start_num + num_chars (num_bytes) is bigger than the text length, the function returns the string from star_num to the end of the text string.

- Num_chars, num_bytes must be a positive integer, if it is a negative number, the function returns an error value.

For example

MID and MIDB functions to cut strings in Excel Picture 2

So that you have learned about MID () and MIDB () string functions, you can combine them with other functions to achieve high efficiency in the process of string processing. Good luck!

4 ★ | 2 Vote

May be interested

  • Complete financial functions in Excel you should knowComplete financial functions in Excel you should know
    fv, date, time, hour, workday, ... functions are the basic financial functions with the same way of getting color codes in excel. show you how to use these financial functions. click view now!
  • SEARCH () and SEARCHB () functions in ExcelSEARCH () and SEARCHB () functions in Excel
    the search () function and the searchb () function are two functions that help you process strings in excel. when you need to find the starting position of a substring in a text string without case or case, you use the search () or searchb () function.
  • MS Excel - Lesson 5: Excel formulas and functionsMS Excel - Lesson 5: Excel formulas and functions
    the formula in excel is a program that performs calculations on data tables. these formulas perform very precise operations such as adding, multiplying, or comparing values ​​in worksheets.
  • The function takes a string in ExcelThe function takes a string in Excel
    the function takes a string in excel. the function to get the string in excel includes 3 types of left, mid and right with different string functions. to better understand the three types of functions that take these strings, please follow the following article of tipsmake.com.
  • 8 little-known Excel functions that can save you a lot of work8 little-known Excel functions that can save you a lot of work
    even seasoned excel users often find themselves stuck performing tasks manually that could be automated with a few clever functions.
  • Summary of information functions in ExcelSummary of information functions in Excel
    to facilitate the selection of functions to suit the requirements when you need to process information in excel spreadsheets. the following article summarizes the functions along with the functions of each function group in the excel spreadsheet.
  • How to split strings in ExcelHow to split strings in Excel
    in excel when working with character strings, there are many cases where it is necessary to split a string to use the data, but the amount of data needs to be separated quite large, if merely manually doing it takes a lot of time and effort. strength. the following article guides to
  • Comparison functions in Excel - How to use comparison functions and examples using comparison functionsComparison functions in Excel - How to use comparison functions and examples using comparison functions
    comparison functions in excel - how to use comparison functions and examples using comparison functions with a large amount of data, you want to check for duplicates by checking normally, it is really hard. in this article, introduce to you the functions
  • How to separate text strings by commas or spaces in ExcelHow to separate text strings by commas or spaces in Excel
    separating text strings based on commas or spaces is a trick that helps you split the characters in a parameter cell into different clusters based on commas or spaces that parameter cell contains. tipsmake will guide you how to separate text strings by commas or spaces in excel.
  • The LOWER, UPPER and PROPER case-conversion functions in ExcelThe LOWER, UPPER and PROPER case-conversion functions in Excel
    in the text function group, the text conversion functions in the text are quite necessary and often used when manipulating, processing text and strings.