View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Formatting Question

On Thu, 23 Feb 2006 08:25:16 -0800, "Carey Abercrombie" <Carey
wrote:

Can you take first/last names in a column and automatically format them to
initials for redacting purposes?


You cannot do this with formatting, but you can use a function.

Is that all that is in the column? Are there any middle names, titles or
suffixes?

The following will return the first letter of the first word in the cell,
followed by the first letter of the last word in the cell. So it will handle
cells containing just first/last or first/middle/last.

An initial followed by a space or a dot will be treated as a word. In other
words "J. R. Jones" would return "JJ"

1. Download and install Longre's free morefunc.xll add-in from
http://xcell05.free.fr/

Note that if you install with all options, there will be a menu entry (tools
menu) to allow you to distribute it with the workbook).

2. With your data in A1, use the following formula:

=REGEX.MID(A1,"^\w")&REGEX.MID(A1,"\w(?=\S*$)")


--ron