ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Text Formating (https://www.excelbanter.com/excel-discussion-misc-queries/51211-text-formating.html)

Ben

Text Formating
 
I have a spreadsheet where 1 column = firstname and initial. For
example Dave C.

How can I mask the cell to be just the first name?

Thanks

Ben


Dave O

Text Formating
 
Yes, using a formula like this
=MID(D7,1,FIND(" ",D7,1)-1)
where D7 contains the name in question. This formula returns
everything before the first blank space in the entry- which is great
until you run into Mary Ann X, who gets converted to Mary.


Ben

Text Formating
 
You da man, thank you


Ben

Text Formating
 
It works! But.....I get a #VALUE! if the name does not have a
firstname and initial, can you help?


Dave O

Text Formating
 
Sorry for the delayed response- try this:
=IF(ISNUMBER(FIND(" ",D7,1)),MID(D7,1,FIND(" ",D7,1)-1),D7)



All times are GMT +1. The time now is 05:06 PM.

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