Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default "uncombine" data in a cell

Hi.

I have data in C3 as a reference to a name, either 2 or 3 letters followed
four numbers. I am trying to split this down over 2 cells with the letters
in A3 and the numbers in B3. The problem is i have two types of reference,
for example, hon2940 and po7951.

Can this be done? I know you can combine using "A3&B3" in C3, but i need to
go the other way. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default "uncombine" data in a cell

to get the letters at the beginning of entry in C3:
=LEFT(C3,LEN(C3)-4)
to get the numbers from it
=RIGHT(C3,4)

Hope that helps you out.

"Iain" wrote:

Hi.

I have data in C3 as a reference to a name, either 2 or 3 letters followed
four numbers. I am trying to split this down over 2 cells with the letters
in A3 and the numbers in B3. The problem is i have two types of reference,
for example, hon2940 and po7951.

Can this be done? I know you can combine using "A3&B3" in C3, but i need to
go the other way. Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 99
Default "uncombine" data in a cell

Hi Ian,

try this: In A3, enter the following formula
=SUBSTITUTE(C3,RIGHT(C3,SUMPRODUCT((LEN(C3)-LEN(SUBSTITUTE(C3,{0,1,2,3,4,5,6,7,8,9},""))))),"" )

and in B3, enter

=--RIGHT(C3,SUMPRODUCT((LEN(C3)-LEN(SUBSTITUTE(C3,{0,1,2,3,4,5,6,7,8,9},"")))))

(note the double negative to coerce Excel to recognise the result as a
number.)

These should return only the leading letters and the trailing numbers.

Dave

"Iain" wrote:

Hi.

I have data in C3 as a reference to a name, either 2 or 3 letters followed
four numbers. I am trying to split this down over 2 cells with the letters
in A3 and the numbers in B3. The problem is i have two types of reference,
for example, hon2940 and po7951.

Can this be done? I know you can combine using "A3&B3" in C3, but i need to
go the other way. Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default "uncombine" data in a cell

Hi, and thanks for that. That works when there are 3 letters in the
reference, but not when there are 2. Is there a way of differentiating
between this, and automatically altering the "-4" to "-3"?

"JLatham" wrote:

to get the letters at the beginning of entry in C3:
=LEFT(C3,LEN(C3)-4)
to get the numbers from it
=RIGHT(C3,4)

Hope that helps you out.

"Iain" wrote:

Hi.

I have data in C3 as a reference to a name, either 2 or 3 letters followed
four numbers. I am trying to split this down over 2 cells with the letters
in A3 and the numbers in B3. The problem is i have two types of reference,
for example, hon2940 and po7951.

Can this be done? I know you can combine using "A3&B3" in C3, but i need to
go the other way. Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default "uncombine" data in a cell

Hi Dave. That works a treat. Thankyou, you have saved me retyping over a
hundred references, and various other formulas.

"Dave Curtis" wrote:

Hi Ian,

try this: In A3, enter the following formula
=SUBSTITUTE(C3,RIGHT(C3,SUMPRODUCT((LEN(C3)-LEN(SUBSTITUTE(C3,{0,1,2,3,4,5,6,7,8,9},""))))),"" )

and in B3, enter

=--RIGHT(C3,SUMPRODUCT((LEN(C3)-LEN(SUBSTITUTE(C3,{0,1,2,3,4,5,6,7,8,9},"")))))

(note the double negative to coerce Excel to recognise the result as a
number.)

These should return only the leading letters and the trailing numbers.

Dave

"Iain" wrote:

Hi.

I have data in C3 as a reference to a name, either 2 or 3 letters followed
four numbers. I am trying to split this down over 2 cells with the letters
in A3 and the numbers in B3. The problem is i have two types of reference,
for example, hon2940 and po7951.

Can this be done? I know you can combine using "A3&B3" in C3, but i need to
go the other way. Thanks.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default "uncombine" data in a cell

On Tue, 3 Feb 2009 05:01:01 -0800, Iain wrote:

Hi.

I have data in C3 as a reference to a name, either 2 or 3 letters followed
four numbers. I am trying to split this down over 2 cells with the letters
in A3 and the numbers in B3. The problem is i have two types of reference,
for example, hon2940 and po7951.

Can this be done? I know you can combine using "A3&B3" in C3, but i need to
go the other way. Thanks.


A3: (letters)
=LEFT(C3,MIN(SEARCH({1,2,3,4,5,6,7,8,9,0},C3&"1234 567890"))-1)

B3: (numbers)
=MID(C3,MIN(SEARCH({1,2,3,4,5,6,7,8,9,0},C3&"12345 67890")),99)


--ron
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default "uncombine" data in a cell

Works both ways for me. The "4" refers to the number of numeric digits at
the end of the entry in C3. You said 2 or 3 letters (always) followed by 4
digits. Would have been faster than the other solution here, but it would
appear that you're going to need the longer formula for your particular needs.

"Iain" wrote:

Hi, and thanks for that. That works when there are 3 letters in the
reference, but not when there are 2. Is there a way of differentiating
between this, and automatically altering the "-4" to "-3"?

"JLatham" wrote:

to get the letters at the beginning of entry in C3:
=LEFT(C3,LEN(C3)-4)
to get the numbers from it
=RIGHT(C3,4)

Hope that helps you out.

"Iain" wrote:

Hi.

I have data in C3 as a reference to a name, either 2 or 3 letters followed
four numbers. I am trying to split this down over 2 cells with the letters
in A3 and the numbers in B3. The problem is i have two types of reference,
for example, hon2940 and po7951.

Can this be done? I know you can combine using "A3&B3" in C3, but i need to
go the other way. Thanks.

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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION yossie6 Excel Discussion (Misc queries) 1 June 16th 08 12:16 PM
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


All times are GMT +1. The time now is 11:43 AM.

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"