=mid function

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Cell A1 contains 1,274 characters.

My function is: =mid(a1,xxx,12)

Is there a way to determine the position of the first character in
cell A1, besides physically counting over 'xxx' characters?
 
Don't really understand your question.

The position of the first character in A1 is "1".
=Left(A1,12) - BUT -
I'm sure that's not what you're looking for.
Is it ?

Do you want to put the value xxx in a cell B1 and use that ?

=MID(A1,B1,12)

You want to return 12 characters starting at position xxx.
You have to have something to identify or mark that particular starting
point so that the formula can find the position automatically.
For example, to start your 12 characters at a dash (-), you could use this:

=MID(A1,FIND("-",A1,1)+1,12)
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================





A unique letter, number, or character.
Cell A1 contains 1,274 characters.

My function is: =mid(a1,xxx,12)

Is there a way to determine the position of the first character in
cell A1, besides physically counting over 'xxx' characters?
 
What do you mean? xxx IS the position. The first character is at position = 1. Your function
returns 12 characters beginning at position = XXX.
 
Gary,

Your question is vague. Do you mean "return 12 characters from wherever
'xxx' is found in the text?"

=MID(A2,SEARCH("xxx",A2),12)
=MID(A2,SEARCH("xxx",A2)+3,12)

Earl Kiosterud
mvpearl omitthisword at verizon period net
 
Back
Top