Space after Mid Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using mid and then concatenate to get the text I need for another
workbook. However, there is a space being inserted from the mid function, so
that when I use concatenate, an extra space appears. Here are the two
functions, they are in side by side columns.
=MID(F1,5,30) 'this is producing a space at the end. To test, copy the
result and paste special values.
=CONCATENATE(G1,"-",C1) is in the next column.
This is the result I get after using both:
Austin -TX 'The space is before the -

Thanks...this one I just can't figure!
 
Try

=MID(Trim(F1),5,30)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Hi David,

You don't tell us the content of F1 that definitely affect hte result of
MID. Nevertheless =TRIM(MID(F1,5,30)) will remove the extra space.

Regards,
Stefi


„David†ezt írta:
 
MID won't tack on a space, but if the 34th character of the string in F1 is a
space, then that will be the final character returned by the MID function
with the arguments you gave it. Either take one less character,
=mid(f1,5,29), or use the TRIM function to remove leading and trailing
spaces, =trim(mid(f1,5,30))
 
Simple as that Bob...thank you very much!!

Bob Phillips said:
Try

=MID(Trim(F1),5,30)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Nice one, Chip! I haven't seen that addin before now. Clever idea, useful
result.

Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Concatenate error 3
Concatenate Function 3
How to get current row-column? 1
Strange?! 6
Pullng data out of string of text 4
space between text strings with concatenate 2
Hidden Characters? 2
CountIf - mid() 3

Back
Top