# Formula to clean up data

#### tesleen2025

##### New Member
Hi, I need a formula to clean up the below text. I only want the numbers from each section code.
So for 393.60(d) I only want to see 393.60
I'm having trouble with this one since they vary so much from code to code.

 Section 396.11 393.60(d) 393.201(c) 393.47(e) 393.9T 396.3(a)(1) 393.51 393.90 393.45B2PC 393.90

<tbody>
</tbody>

Thank you,
tesleen

### Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

#### CyrusTheVirus

##### Well-known Member
Welcome to the forums. Try out the below formula, hope this works for you. It assumes that all cells have a decimal within the number.

Enter the formula with Ctrl+Shift+Enter, not just Enter.

B2:
Code:
``=IF(ISNUMBER(A2),A2,VALUE(LEFT(A2,SMALL(IF(ISERROR(VALUE(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1))),ROW(INDIRECT("1:"&LEN(A2)))),2)-1)))``

 Section Extraction 396.11 396.11 393.60(d) 393.6 393.201(c) 393.201 393.47(e) 393.47 393.9T 393.9 396.3(a)(1) 396.3 393.51 393.51 393.9 393.9 393.45B2PC 393.45 393.9 393.9

<tbody>
</tbody><colgroup><col><col></colgroup>

Last edited:

#### Trustee

##### New Member
Hi, I need a formula to clean up the below text. I only want the numbers from each section code.
So for 393.60(d) I only want to see 393.60
I'm having trouble with this one since they vary so much from code to code.

 Section 396.11 393.60(d) 393.201(c) 393.47(e) 393.9T 396.3(a)(1) 393.51 393.90 393.45B2PC 393.90

<tbody>
</tbody>

Thank you,
tesleen

=SUMPRODUCT(MID(0&A1,LARGE(INDEX(ISNUMBER(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))*ROW(INDIRECT("1:"&LEN(A1))),0,1),ROW(INDIRECT("1:"&LEN(A1))))+1,1)*10^(ROW(INDIRECT("1:"&LEN(A1)))-1))
Please let me know if you have any query.

#### CyrusTheVirus

##### Well-known Member
Hi Trustee,

I do not think that your formula will give OP what they want. Your formula removes the decimals therefore changing the number to go from something like 393.60 to 39360... and it also includes ALL numbers, which could 'technically' be what OP wants, but probably not, for instance your formula makes 396.3(a)(1) turn into 39631.

Last edited:

#### tesleen2025

##### New Member
Cyrus,
This formula worked perfect. Thank you!

#### CyrusTheVirus

##### Well-known Member
Good to hear. You're welcome.

Replies
5
Views
591
Replies
3
Views
545
Replies
6
Views
834
Replies
25
Views
2K
Replies
7
Views
694

1,195,849
Messages
6,011,955
Members
441,657
Latest member
Diupsy

### 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.

### Which adblocker are you using?

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

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