The excel MID function extracts a certain number of texts from the specified position.
The MID function acts like the LEFT function if it takes characters from the first position or works like the RIGHT function if the number of characters taken reaches the end of the text.
MID(text, start_num, num_chars)
text, required, the text containing the characters to extract from.
start_num, required, the first character position to extract.
num_char, required, the number of characters to extract.
The following is an example of the MID function usage and the results.
=MID(A2,12,5)
You got nothing it start_num argument greater then text length.
=MID(A3,8,1000)
If num_char argument exceeds the text length, whatever the number you get the characters up to the end of the text.
=MID(A4,0,6)
#VALUE! error appears if the start_num argument is smaller than 1, it could be 0 (zero) or a negative number.
=MID(A5,1,6)
The MID function returns the same value as the LEFT function if start_num argument is equal to 1.
The MID Function #4 result is the same as the LEFT(A5,6) formula.
=MID(A6,8,4)
The results of the MID function and the RIGHT function are the same if the num_char argument plus start_num argument is equal to the text length.
The MID function #5 result is the same as the RIGHT(A6,4) formula.
=MID(A7,2,2)
The MID function can extract from a number too.
=MID(A8,2,2)
Alphanumeric is not a problem for the MID function, because alphanumeric is a text.
=MID(A9,2,2)
The MID function returns the same results for numbers 123456 and “Wednesday, January 3, 2238”. Why? Because Excel stores date in an integer number. “Wednesday, January 3, 2238” is the result of “Format cells” menu. The real value is an integer number 123456.
The MID function extracts the number but ignores the cell format.
=MID(A10,2,2)
Why are the results of MID Function #9 and #10 not the same? Because cell A9 contains a date and cell A10 contains a text.
“Wednesday, January 3, 2238” in cell A9 is the result of the format cell menu while in cell A10 is the real value.
=MID(A11,2,4)
Just like integer numbers, the MID function can extract decimal numbers and assuming decimal separators as one character.
=MID(A12,2,4)
The results are like MID Function #10. Excel stores date value in integer number, while for time value excel stores as a decimal number.
If you format 2:57:46 AM to number-general the result is 0.12345.
Calculate Number of Days Between Two Dates Excel has a function that calculates the number of days between two dates,…
What is Flash Fill Excel Flash Fill automatically fills your data when Excel detects a pattern in your initial data…
What is Paste Special Paste special is a paste but you can choose the result type. As we all know,…
What is the Excel TEXTJOIN Function? The excel TEXTJOIN function is the best function to concatenate strings in Excel, has…
What is the Excel CONCAT Function? The excel CONCAT function combines all data; it could be a text, a number…
What is the Excel CONCATENATE Function? The excel CONCATENATE function combines text or numbers into a text. CONCATENATE Syntax CONCATENATE(text1,…