ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I include part of a cell in text (string?) in another cell? (https://www.excelbanter.com/excel-worksheet-functions/147795-how-do-i-include-part-cell-text-string-another-cell.html)

Chris Mitchell

How do I include part of a cell in text (string?) in another cell?
 
I have a spreadsheet in which A:1 contains First and Second Names as a
single entry, e.g. 'Fred Smith'.

I want to be able to include only the First Name in statements in other
fields, e.g. 'Fred can .' I have considered splitting the name across two
fields, but this would introduce other complications.

How can I refer to A:1 such that only the first name, which is of variable
length, will be picked up, i.e. everything up to, and possibly including'
the space?

I know I can use '=A:1& 'can.'' which will come out as 'Fred Smith can.',
but how do I make it read 'Fred can.'?



Rick Rothstein \(MVP - VB\)

How do I include part of a cell in text (string?) in another cell?
 
I have a spreadsheet in which A:1 contains First and Second Names as a
single entry, e.g. 'Fred Smith'.

I want to be able to include only the First Name in statements in other
fields, e.g. 'Fred can .' I have considered splitting the name across two
fields, but this would introduce other complications.

How can I refer to A:1 such that only the first name, which is of variable
length, will be picked up, i.e. everything up to, and possibly including'
the space?

I know I can use '=A:1& 'can.'' which will come out as 'Fred Smith can.',
but how do I make it read 'Fred can.'?


This formula...

=LEFT(A6,FIND(" ",A6)-1)

will pick up the text up to, but not including, the space following it. If
you want to keep the space, remove the -1.

Rick


Chris Mitchell

How do I include part of a cell in text (string?) in another cell?
 
Thanks Rick, works a treat.
"Rick Rothstein (MVP - VB)" wrote in
message ...
I have a spreadsheet in which A:1 contains First and Second Names as a
single entry, e.g. 'Fred Smith'.

I want to be able to include only the First Name in statements in other
fields, e.g. 'Fred can .' I have considered splitting the name across two
fields, but this would introduce other complications.

How can I refer to A:1 such that only the first name, which is of
variable length, will be picked up, i.e. everything up to, and possibly
including' the space?

I know I can use '=A:1& 'can.'' which will come out as 'Fred Smith can.',
but how do I make it read 'Fred can.'?


This formula...

=LEFT(A6,FIND(" ",A6)-1)

will pick up the text up to, but not including, the space following it. If
you want to keep the space, remove the -1.

Rick





All times are GMT +1. The time now is 04:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com