Trying to remove everything but the numbers from 446818 rows

BirbinaRoadster

New Member
Joined
Mar 1, 2018
Messages
4
Hi there,

I'm confident with using Access but Excel is very new and confusing to me. I have been given 446818 ISBN numbers in a text file, some are 13 numbers long and some are 10 long. Where the information was pulled, some of the numbers had text after them e.g: (paperback). When the text file was created, it was done so that the 13 digit numbers worked fine but some of the short ones now have all sorts of random stuff showing e.g: (p, (c, |, :, X and some rows have random bits of text on them. I need these numbers to be clean so that we can put them into another database.

I've been searching all morning on google for anything that can help but I haven't had any success. Surely there is some simple function that can do this or maybe my expectations of excel are way too high :rolleyes: I hope someone can help!

Thank you so much!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi BirbinaRoadster,

Welcome to MrExcel!!

Assuming there's a space after the ISBN number that's followed by the text and the first cell is A2, you can put this formula into an empty cell...

=VALUE(LEFT(A2,SEARCH(" ",A2)-1))

...and copy it down as far as required.

HTH

Robert
 
Last edited:
Upvote 0
Hi there,

I'm confident with using Access but Excel is very new and confusing to me. I have been given 446818 ISBN numbers in a text file, some are 13 numbers long and some are 10 long. Where the information was pulled, some of the numbers had text after them e.g: (paperback). When the text file was created, it was done so that the 13 digit numbers worked fine but some of the short ones now have all sorts of random stuff showing e.g: (p, (c, |, :, X and some rows have random bits of text on them. I need these numbers to be clean so that we can put them into another database.
What is your ultimate result goal for the text file... to create a "clean" text file or to put clean information into an Excel worksheet?
 
Upvote 0
Thank you for trying, this worked for some but not all

Can you post some examples where it didn't work? Is there a pattern where it's not working i.e. for ISBN numbers that are 10 digits or when they're 13 digits?

As long as every entry starts with an ISBN, see if this formula is better:

=IF(ISNUMBER(VALUE(LEFT(A2,13))),VALUE(LEFT(A2,13)),VALUE(LEFT(A2,10)))
 
Last edited:
Upvote 0
Hi,

If the data/numbers you want extracted is Always at the beginning of the string and up to 13 digits, this should work:


Book1
AB
11234567890 asdf1234567890
21234567890asdf1234567890
31234567890123 asdf1234567890123
41234567890123asdf1234567890123
59999999999999 asdf9999999999999
69999999999999asdf9999999999999
Sheet6
Cell Formulas
RangeFormula
B1=LOOKUP(10^13,0+LEFT(A1,ROW($1:$13)))


Formula copied down.
 
Last edited:
Upvote 0
Another formula to consider if your numbers can Only by either 13 or 10 digits.
B1 formula will extract anywhere from 1 to 13 digits, C1 formula will only be accurate for 13 or 10 digits.


Book1
ABC
11234567890 asdfg12345678901234567890
21234567890asdf12345678901234567890
31234567890123 asdf12345678901231234567890123
41234567890123asdfg12345678901231234567890123
59999999999999 asdf99999999999999999999999999
69999999999999asdf99999999999999999999999999
Sheet6
Cell Formulas
RangeFormula
B1=LOOKUP(10^13,0+LEFT(A1,ROW($1:$13)))
C1=LEFT(A1,IF(ISNUMBER(LEFT(A1,13)+0),13,10))+0
 
Upvote 0
Thanks for all your help guys! I've had a bit of a play around with your suggestions and have managed to clean it up pretty well now :)
 
Upvote 0
You're welcome, welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,215,881
Messages
6,127,527
Members
449,385
Latest member
KMGLarson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top