Solved

Need a Excel formula to remove numbers at end of lines of text that are of varying lengths & # of digits

Posted on 2014-07-25
2
2,643 Views
Last Modified: 2014-07-25
I was able to figure out the TRIM formula to extract the numbers at the end of each line of the SAMPLE TEXT (below) into column C:
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",LEN(A2))),LEN(A2)))

Next I would like to extract just the text strings, without the numbers (or space in front of the numbers), into column B from the SAMPLE TEXT below. I've taken a few stabs at it but have only managed to extract the first word in each line and not the entire text string.

SAMPLE TEXT:
Documents (in Book) Total 239
Frame generatable file(Skipped, Unprocessed) 0
Unable to generate due to Errors 0
Generated OK 239
Generated containing Warnings or Errors 0
Text Amendments (Insertions/Deletions) Total 40
Activated 40
Warnings or Errors 0
DataLinks (Links to Database) Total 3730
New 23
Changed 45
Warnings or Errors 0

Thanks,
Andrea
0
Comment
Question by:Andreamary
2 Comments
 
LVL 19

Accepted Solution

by:
helpfinder earned 500 total points
ID: 40219324
use this formula (I assume your data ar in A column)
note that based on your regional settings you may need to replace semicolon (;) sign in formula by comma (,)
=LEFT(A1;LEN(A1)-LEN(MID(A1;FIND(CHAR(22);SUBSTITUTE(A1;" ";CHAR(22);LEN(A1)-LEN(SUBSTITUTE(A1;" ";""))))+1;255))-1)

see also attached sample
sample.xlsx
0
 

Author Closing Comment

by:Andreamary
ID: 40219345
Thanks for your quick response, helpfinder! I converted the semi-colons to commas and the formula worked perfectly.

Cheers,
Andrea
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now