Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default IF a cell only contains a specific character then reformat the tex

Hello, I was wondering if someone could steer me in the right direction.
Here is my sample:
A1=GEORGE(ABC)
A2=BOB
A3=SAM (WMC)

I would like to get:
B1=George
B2=Bob
A3=Sam

c1=ABC
c2=
c3=WMC

I'm trying to use an IF statement to look at ie: cell a1 and covert it from
all caps to proper first letter cap and the rest lower, and remove the (ABC).
I used: =MID(a1,FIND("(",a1)+1,(FIND(")",a1)-FIND("(",a1)-1)) which put the
ABC in it's own field C1.
my problem is that when I copy down that formula to ie: A2 i get the #Value!
error because there is no parenthis in that field.
Since i have about 1000 records, i'd like to use just the same formula for
the whole thing but I can't get the darn IF statement to work. It keeps
throwing me a REF! error. If haven't use IF that much so i'm sure i'm using
it incorrectly.
=IF(FIND("(",A3),PROPER(LEFT(A3,FIND("(",A3)-1)),PROPER(A3))
Basically look at A3, if A3 contains a "(" then give me the proper(A3)
without the (WMC). If it doesn't contain "(" then just give me proper(A3)

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 171
Default IF a cell only contains a specific character then reformat the tex

Rather than IF(FIND( ), ... ), try
IF(NOT(ISERROR(FIND( ))), ...)
The problem is that when the FIND fails, you've got #VALUE, where the IF is
looking for TRUE or FALSE; the NOT(ISERROR( )) will return TRUE if the find
succeeded and false otherwise. (You could leave out the NOT, and reverse the
true/false actions)

"Craig860" wrote:

Hello, I was wondering if someone could steer me in the right direction.
Here is my sample:
A1=GEORGE(ABC)
A2=BOB
A3=SAM (WMC)

I would like to get:
B1=George
B2=Bob
A3=Sam

c1=ABC
c2=
c3=WMC

I'm trying to use an IF statement to look at ie: cell a1 and covert it from
all caps to proper first letter cap and the rest lower, and remove the (ABC).
I used: =MID(a1,FIND("(",a1)+1,(FIND(")",a1)-FIND("(",a1)-1)) which put the
ABC in it's own field C1.
my problem is that when I copy down that formula to ie: A2 i get the #Value!
error because there is no parenthis in that field.
Since i have about 1000 records, i'd like to use just the same formula for
the whole thing but I can't get the darn IF statement to work. It keeps
throwing me a REF! error. If haven't use IF that much so i'm sure i'm using
it incorrectly.
=IF(FIND("(",A3),PROPER(LEFT(A3,FIND("(",A3)-1)),PROPER(A3))
Basically look at A3, if A3 contains a "(" then give me the proper(A3)
without the (WMC). If it doesn't contain "(" then just give me proper(A3)

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default IF a cell only contains a specific character then reformat the tex

And instead of using:
=if(not(iserror(find(...

you could use:
=if(isnumber(find(....

a little easier to read.



bpeltzer wrote:

Rather than IF(FIND( ), ... ), try
IF(NOT(ISERROR(FIND( ))), ...)
The problem is that when the FIND fails, you've got #VALUE, where the IF is
looking for TRUE or FALSE; the NOT(ISERROR( )) will return TRUE if the find
succeeded and false otherwise. (You could leave out the NOT, and reverse the
true/false actions)

"Craig860" wrote:

Hello, I was wondering if someone could steer me in the right direction.
Here is my sample:
A1=GEORGE(ABC)
A2=BOB
A3=SAM (WMC)

I would like to get:
B1=George
B2=Bob
A3=Sam

c1=ABC
c2=
c3=WMC

I'm trying to use an IF statement to look at ie: cell a1 and covert it from
all caps to proper first letter cap and the rest lower, and remove the (ABC).
I used: =MID(a1,FIND("(",a1)+1,(FIND(")",a1)-FIND("(",a1)-1)) which put the
ABC in it's own field C1.
my problem is that when I copy down that formula to ie: A2 i get the #Value!
error because there is no parenthis in that field.
Since i have about 1000 records, i'd like to use just the same formula for
the whole thing but I can't get the darn IF statement to work. It keeps
throwing me a REF! error. If haven't use IF that much so i'm sure i'm using
it incorrectly.
=IF(FIND("(",A3),PROPER(LEFT(A3,FIND("(",A3)-1)),PROPER(A3))
Basically look at A3, if A3 contains a "(" then give me the proper(A3)
without the (WMC). If it doesn't contain "(" then just give me proper(A3)


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default IF a cell only contains a specific character then reformat the

ahhh! That makes sense! Here's what I came up with:
=IF(NOT(ISERROR(FIND("(",a3)-1)),PROPER((LEFT(a3,FIND("(",a3)-1))),PROPER(a3))

Thanks a lot!

"bpeltzer" wrote:

Rather than IF(FIND( ), ... ), try
IF(NOT(ISERROR(FIND( ))), ...)
The problem is that when the FIND fails, you've got #VALUE, where the IF is
looking for TRUE or FALSE; the NOT(ISERROR( )) will return TRUE if the find
succeeded and false otherwise. (You could leave out the NOT, and reverse the
true/false actions)

"Craig860" wrote:

Hello, I was wondering if someone could steer me in the right direction.
Here is my sample:
A1=GEORGE(ABC)
A2=BOB
A3=SAM (WMC)

I would like to get:
B1=George
B2=Bob
A3=Sam

c1=ABC
c2=
c3=WMC

I'm trying to use an IF statement to look at ie: cell a1 and covert it from
all caps to proper first letter cap and the rest lower, and remove the (ABC).
I used: =MID(a1,FIND("(",a1)+1,(FIND(")",a1)-FIND("(",a1)-1)) which put the
ABC in it's own field C1.
my problem is that when I copy down that formula to ie: A2 i get the #Value!
error because there is no parenthis in that field.
Since i have about 1000 records, i'd like to use just the same formula for
the whole thing but I can't get the darn IF statement to work. It keeps
throwing me a REF! error. If haven't use IF that much so i'm sure i'm using
it incorrectly.
=IF(FIND("(",A3),PROPER(LEFT(A3,FIND("(",A3)-1)),PROPER(A3))
Basically look at A3, if A3 contains a "(" then give me the proper(A3)
without the (WMC). If it doesn't contain "(" then just give me proper(A3)

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
HOW DO I SORT DATA USING A SPECIFIC CHARACTER IN A CELL GEORGE Excel Discussion (Misc queries) 1 May 31st 07 04:42 PM
Add number from a cell that contains a specific character Carole Excel Worksheet Functions 0 January 4th 07 09:01 PM
How do I remove all text in a cell after a specific character? Erik Millerd Excel Worksheet Functions 1 July 13th 05 03:17 PM
HOW to COUNT THE FREQUENCY of specific CHARACTER WITHIN a CELL? Shooting Star Excel Discussion (Misc queries) 1 February 22nd 05 10:15 PM
Search for a specific character in a cell in an if statement mcl Excel Worksheet Functions 2 January 4th 05 09:14 PM


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

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"