Use of MID

M

Malinmore

if cell J2 has the text string - this is a test - and I wanted to refer to
J2 using MID - how do I point to the cell J2 as the text string?

Thanks in advance
 
T

Trevor Shuttleworth

=MID(J2, start ,length) where "start" is the start of the text you want and
"length" is the length.

See the Excel Help:

MID

Also applies to:

MIDB

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

MIDB returns a specific number of characters from a text string, starting at
the position you specify, based on the number of bytes you specify. This
function is for use with double-byte characters.

Syntax

MID(text,start_num,num_chars)

MIDB(text,start_num,num_bytes)

Text is the text string containing the characters you want to extract.

Start_num is the position of the first character you want to extract in
text. The first character in text has start_num 1, and so on.

Num_chars specifies the number of characters you want MID to return from
text.

Num_bytes specifies the number of characters you want MIDB to return from
text, in bytes.

Remarks

a.. If start_num is greater than the length of text, MID returns "" (empty
text).
b.. If start_num is 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.
c.. If start_num is less than 1, MID returns the #VALUE! error value.
d.. If num_chars is negative, MID returns the #VALUE! error value.

e.. If num_bytes is negative, MIDB returns the #VALUE! error value.

Regards

Trevor
 
M

Malinmore

OK - I had the syntax correct, but I'm attempting to read a number that I've
reformatted as text, but they still do not work.

The cell reads 1955515 and I want to get the first 3 characters. If I retype
the 1955515, it my MID statement works, but I'd like to forgo retyping them
as the column contains 1200 entries.
 
Top