Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 38
Default if and replace function?

Hello
I need help
I have names on my left and depending on the name I need to remove a space

Original data Answer
John, Repp John,Repp
Jay, Thorp Jay, Thorp
Jana, Washington Jana,Washington

So just depending on the name some need the space after the "," trim and some dont I have a total of about 40 names only about 6 dont need the space after the coma.
I was thinking of Replace and If But I cant seem to put it together.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 38
Default if and replace function?

On Wednesday, May 22, 2013 12:57:40 PM UTC-5, wrote:
Hello I need help I have names on my left and depending on the name I need to remove a space Original data Answer John, Repp John,Repp Jay, Thorp Jay, Thorp Jana, Washington Jana,Washington So just depending on the name some need the space after the "," trim and some dont I have a total of about 40 names only about 6 dont need the space after the coma. I was thinking of Replace and If But I cant seem to put it together.




There are certain names that have to remain the same as the original data
but another 36 or so I have to trim the space after the comma
So I would have to hard code those 36 names in the formula if you can just hard code 2 for me I can do the rest.
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default if and replace function?

Hi again,

Am Wed, 22 May 2013 20:58:39 +0200 schrieb Claus Busch:

=IF(COUNTIF($H$1:$H$36,A1)=0,SUBSTITUTE(A1,", ",","),A1)


if there are only 6 names to remove the space it is easier to write this
6 names in column H and then:
=IF(COUNTIF($H$1:$H$6,A1)0,SUBSTITUTE(A1,", ",","),A1)



Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 38
Default if and replace function?

On Wednesday, May 22, 2013 12:57:40 PM UTC-5, wrote:
Hello I need help I have names on my left and depending on the name I need to remove a space Original data Answer John, Repp John,Repp Jay, Thorp Jay, Thorp Jana, Washington Jana,Washington So just depending on the name some need the space after the "," trim and some dont I have a total of about 40 names only about 6 dont need the space after the coma. I was thinking of Replace and If But I cant seem to put it together.




Thank you Clause this works great
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
len replace function tom_mcd[_2_] Excel Programming 11 February 9th 10 03:34 PM
Can you have a value created by a function replace the function? xak1222 Excel Worksheet Functions 3 September 10th 09 09:37 AM
Using the replace function less caldog Excel Worksheet Functions 0 January 4th 07 07:48 PM
Replace Function Autumn Dreams Excel Discussion (Misc queries) 3 June 4th 06 12:33 PM
Replace XLA with XLL function Jens Thiel[_2_] Excel Programming 12 September 22nd 04 02:17 PM


All times are GMT +1. The time now is 02:08 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"