Reputation: 33
I have a string like ssfdfksakf + 232332
Text, plus sign then number of any length.
I want the easiest way to extract the number without the whitespace or anything.
Upvotes: 0
Views: 1830
Reputation: 59460
Take a copy and on that use Find & Select with Find what:
*
(there is a space after the asterisk) and Replace with: left blank.
Upvotes: 0
Reputation: 60199
This finds the first digit, then returns the rest of the string:
=MID(A1,MIN(FIND({0;1;2;3;4;5;6;7;8;9},A1&"0123456789")),99)
If you require the result to be numeric, then precede with a double unary:
=--MID(A1,MIN(FIND({0;1;2;3;4;5;6;7;8;9},A1&"0123456789")),99)
Upvotes: 2
Reputation: 46323
You could grab anything after the plus sign and then trim it:
=TRIM(MID(A1, FIND("+", A1) + 1, 999))
Upvotes: 1
Reputation:
You should convert the result to a true number with a double unary (aka double minus) after extracting the number portion as a string.
=--MID(A2, FIND("+", A2&"+ ")+1, 255)
Upvotes: 1