LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Toppers
 
Posts: n/a
Default Splitting cells using formula; RIGHT/LEFT not applicable

Thanks Harlan .... I was sure mine could be improved!

"Harlan Grove" wrote:

Toppers wrote...
Assuming data in A1:

in B1:

=LEFT(A1,FIND("-",A1)-1)

in C1:

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,"-",""))=2,
MID(A1,LEN(B1)+2,FIND("-",A1,LEN(B1)+2)-(LEN(B1)+2)),
RIGHT(A1,LEN(A1)-(LEN(B1)+1)))


Could be shortened to

=MID(A1,LEN(B1)+2,FIND("-",REPLACE(A1&"-",1,LEN(B1)+1,""))-1)

in D1:

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,"-",""))=2,
RIGHT(A1,LEN(A1)-(LEN(B1)+LEN(C1)+2)),"")


Could be shortened to

=MID(A1,LEN(B1)+LEN(C1)+3,LEN(A1))


 
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
What formula is used for subtracting a range of different cells f. tim Excel Worksheet Functions 3 April 21st 23 10:07 PM
quick way to copy-paste a formula linked to cells in another file iniakupake Excel Worksheet Functions 2 September 26th 05 03:56 AM
Formula works in some cells, doesn't in other Wowbagger New Users to Excel 13 June 30th 05 03:21 PM
trying to create an (almost) circular formula between cells and data validated cells with lists KR Excel Worksheet Functions 0 May 12th 05 07:21 PM
Applying formula to only NON-EMPTY cells in range Tasi Excel Discussion (Misc queries) 5 March 29th 05 10:48 PM


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