Extract a number from a string

richiwatts

Board Regular
Joined
Aug 27, 2002
Messages
131
I have a column like this.

Quality Score: 5 (20180412)
Quality Score: 5 (20180220)
Quality Score: 4 (xxxxxxxx)
Quality score: 4 (20180713)
Quality Score; 4 (20180605)

I need to get just the scores in a different column so I can average them in a pivot base don toher criteria I have in other columns.

I was able to get the score in a new column using
=IFERROR(MID(F8,16,LEN(F8)-26))
But then it is not a number it is text so I can't get an average. I tried formatting the numbering but that didn't work.
Can you think of a way I can get just the number? The data is constantly updating so I can't just search and replace, I need a formula or something.

Thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
First you need an extra argument to the formula:
Try:
=IFERROR(MID(F8,16,LEN(F8)-26),0)
The following should convert the result to a number:
=IFERROR(MID(F8,16,LEN(F8)-26),0)*1
 
Upvote 0
Hi,

There are many ways to convert the extracted results to numeric, using either *1, +0, --, etc.

But I would definitely recommend adding that Before the "value if error", if it's added After "value if error", it would just error out again.


Book1
FGH
8Quality Score: 5 (20180412)55
9Quality Score: 5 (20180220)55
10Quality Score: 4 (xxxxxxxx)44
11Quality score: 4 (20180713)44
12Quality Score: 4 (20180605)44
13Quality Score: A (20180605)0#VALUE!
Sheet137
Cell Formulas
RangeFormula
G8=IFERROR(MID(F8,16,LEN(F8)-26)+0,0)
H8=IFERROR(MID(F8,16,LEN(F8)-26),0)*1


Use G8 formula, adjust cell reference as needed, change the 0 (zero - After the Last comma) for "value if error" to "" (Blank) or whatever you want.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,397
Members
448,957
Latest member
Hat4Life

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