View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RJL0323
 
Posts: n/a
Default Split field based on number of characters and space


If I understood correctly you want to split a cell if the number of
characters exceeds 30. And when you split that cell you want to split
it at the first space characted within the cell. When you say split I
am assuming you want all of the characters to the left of the space in
one cell and all of the characters to the right of the space in
another. I also assumed you did not want to inlclude the space in
either cell. If the cell containing over 30 characters is in cell A1
and the split out cell are B1 and C1.

The formula for B1 would be:

=IF(LEN(A1)30,LEFT(A1,FIND(" ",A1)-1),"")

This would capture all of the characters to the left of the space.

The formula for C1 would be:

=IF(LEN(A1)30,RIGHT(A1,LEN(A1)-FIND(" ",A1)),"")

This would capture all of the characters to the right of the space.

Hopefully I understood correctly, let me know if this helps.

Thanks,
Ray


--
RJL0323
------------------------------------------------------------------------
RJL0323's Profile: http://www.excelforum.com/member.php...o&userid=19456
View this thread: http://www.excelforum.com/showthread...hreadid=510058