Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
lmrippey
 
Posts: n/a
Default Make new column using partial text in another cell


I have a member list (210 people) where the names are all in one column:
first name, last name, and "Mr." or "Ms."

My ultimate goal is to have "gender" be an added variable, get rid of
the "Mr." and "Ms.", and split the first and last names into separate
columns. If "Mr.", gender is M, if "Ms.", gender is F.

My problem is creating the gender variable. I have played with FIND
and SEARCH combined with nested IFs, but I'm having problems getting
the formula to work for the 2nd IF. The males (M) works, but the
females (and blanks) end up a #value (see example below). Am I using
the wrong functions?


Here is what I tried:

=IF(SEARCH("Mr.",A1),"M",IF(SEARCH("Ms.",A1),"F"," XXX"))

and

=IF((SEARCH("Mr.",A1)),"M","F")

Results from both formulae:

Jones, Mr. Joe -------------M
Smith, Mr. Stan ----------- M
White, Ms. Betty ----------#VALUE!
Red, Ms. Rose -------------#VALUE!
--------------------------------#VALUE!

I appreciate any suggestions!


--
lmrippey
------------------------------------------------------------------------
lmrippey's Profile: http://www.excelforum.com/member.php...fo&userid=2940
View this thread: http://www.excelforum.com/showthread...hreadid=471897

  #2   Report Post  
bj
 
Posts: n/a
Default

try

=IF(iserror(SEARCH("Mr.",A1)),IF(iserror(SEARCH("M s.",A1)),"XXX","F"),"M")

Your equaiton gave an #value not a false in the if statement

"lmrippey" wrote:


I have a member list (210 people) where the names are all in one column:
first name, last name, and "Mr." or "Ms."

My ultimate goal is to have "gender" be an added variable, get rid of
the "Mr." and "Ms.", and split the first and last names into separate
columns. If "Mr.", gender is M, if "Ms.", gender is F.

My problem is creating the gender variable. I have played with FIND
and SEARCH combined with nested IFs, but I'm having problems getting
the formula to work for the 2nd IF. The males (M) works, but the
females (and blanks) end up a #value (see example below). Am I using
the wrong functions?


Here is what I tried:

=IF(SEARCH("Mr.",A1),"M",IF(SEARCH("Ms.",A1),"F"," XXX"))

and

=IF((SEARCH("Mr.",A1)),"M","F")

Results from both formulae:

Jones, Mr. Joe -------------M
Smith, Mr. Stan ----------- M
White, Ms. Betty ----------#VALUE!
Red, Ms. Rose -------------#VALUE!
--------------------------------#VALUE!

I appreciate any suggestions!


--
lmrippey
------------------------------------------------------------------------
lmrippey's Profile: http://www.excelforum.com/member.php...fo&userid=2940
View this thread: http://www.excelforum.com/showthread...hreadid=471897


  #3   Report Post  
lmrippey
 
Posts: n/a
Default


bj,

That worked perfectly! Thank you so much!


--
lmrippey
------------------------------------------------------------------------
lmrippey's Profile: http://www.excelforum.com/member.php...fo&userid=2940
View this thread: http://www.excelforum.com/showthread...hreadid=471897

Reply
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
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM
How do I reference every "n" cell in a column in Excel? Alma Excel Worksheet Functions 2 March 22nd 05 06:19 PM
Finding Partial Text in a Cell bob Excel Worksheet Functions 6 December 18th 04 05:03 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 03:10 PM.

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

About Us

"It's about Microsoft Excel"