String Manipulation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have data imported from accounting software that I'm working with. What I
need is to have a column that diplays just the length of the part off the end
of the description. Lengths are in formats like 20-1/4, 4, 5-1/4. They are
always preceded by one or more spaces and are always at the end of the
description. Can anyone help? Following are two examples of descriptions
06530FB0325_SP MDP REC PCH 155 3-1/4
12810FB46_SP MDP LO STD PCH 155 46
Q5478MB/W075_DPBSP REC RAL6027 155 7-1/2
 
There are a number of string parsing functions you can use, such as
MID, LEFT, and RIGHT. All of these depend on you knowing where the
desired columns are. In your examples, the lengths are always at the
end, but the lengths are a different number of columns: for instance,
the second one is 46 (2 columns) and the third is 7*1/2 (5 columns).

To make this exact, we need to find an element that is common to each
row *and* close to the length portion of the string. I see the value
155 on each line- if that is common to EVERY line, you could use this
formula
=MID(A2,FIND("155 ",A2,1)+4,LEN(A2))
.... where the imported string is in cell A2.

Is that 155 on every line?
 
On Wed, 30 Nov 2005 13:31:02 -0800, "String Manipulation" <String
I have data imported from accounting software that I'm working with. What I
need is to have a column that diplays just the length of the part off the end
of the description. Lengths are in formats like 20-1/4, 4, 5-1/4. They are
always preceded by one or more spaces and are always at the end of the
description. Can anyone help? Following are two examples of descriptions
06530FB0325_SP MDP REC PCH 155 3-1/4
12810FB46_SP MDP LO STD PCH 155 46
Q5478MB/W075_DPBSP REC RAL6027 155 7-1/2


=MID(A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),
LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,255)


--ron
 
See if this works for you:
=RIGHT(A1,MATCH(" ",MID(A1,LEN(A1)+1-ROW(INDIRECT("1:"&(LEN(A1)))),1),0)-1)

Commit that array formula by holding down [Ctrl] and [Shift] when you press
[Enter]


Does that help?

***********
Regards,
Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top