LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default Parsing for middle initial

Chris,
Your solution works great. I've tested it a couple of times and it looks
like it'll do the job.
Ron,
I'll download your dll and test it too! THANKS for each of you for
participating!!
Tom

"Chris Bruce <Fr.... @aol.com" wrote:

This formula might do what you want
=IF(ISERROR(SEARCH(" ",SUBSTITUTE(C41,"."," "),SEARCH("
",C41,1)+1)),"UnknownMN",UPPER(MID(C41,SEARCH( " ",C41)+1,1)))

The first part looks for a second space or period changed to space
after the middle initial. If the search fails an error returns
UnknownMN otherwise the uppercase middle initial is returned.

Chris

Tom wrote:
I have a set of data column C that is typically
1) FN MI LN or
2) FN LN or
3) FN
where FN = firstname, MI = middle initial and LN= last name.

I've created the proper parsing for the "FN MI LN" and for "FN LN".
However, when I have data in a column that is FN only (or even the LN only
for that matter), I get a #value error in my MI column. That is, a SINGLE
entry in Column C generates the #value error message.

Here's what I have and I'm unable to find where the #value is coming from
and how to correct it.
Is there an easy way to do this rather than just 'looking at the code'?
Like, can I step through the function to see where the error is occurring?
Or even trace the process with resultant 'true/false' or value determinations?

If someone has a solution, GREAT, that would highly appreciated.
So, here's the MI code that generates the #value error message when the
column only contains FN or LN:
=IF(UPPER(C41)="","",IF(MID(C41,FIND(" ",C41,1)+2,1)=".",MID(C41,FIND("
",C41,1)+1,1),IF(MID(C41,FIND(" ",C41,1)+2,1)=" ",MID(C41,FIND("
",C41,1)+1,1)," ")))

If I can't find a good solution, I'll probably save the *.xls into an *.csv
and Replace the #value to blanks.
TIA,



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract Middle Initial from Name Dave Y Excel Worksheet Functions 10 July 11th 07 11:17 PM
Remove middle initial from "first name middle initial" Justin F. Excel Discussion (Misc queries) 15 September 26th 05 06:13 PM
First name, Middle Initial wnfisba Excel Discussion (Misc queries) 2 September 21st 05 03:03 PM
Stripping Middle Initial from a Name mira Excel Worksheet Functions 13 August 6th 05 08:46 PM
Extract middle initial rocket0612 Excel Discussion (Misc queries) 4 July 5th 05 09:05 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"