formula or vba to remove dot, trailing spaces and format numbers to eight digits

RAM1972

Board Regular
Joined
Jun 29, 2014
Messages
217
Hi All

I have an issue with stastistcs id, looking formula or vba to make number to 8 digits as below.

However, after four digits(always) there are trailing space of 1 or 2 or 1 . spaces
the digits will be always 8 numbers , no alphabetical words.

There are eratic blank rows of 1 or 2 or 3 or 4 or more . but should not alter the blank rows
the list goes to 20000 rows of data

Any assistance would be grateful
Sample

4016.991
4016 .991
4016 991
4016 991
4016

should read 4016991

Data header 1

ht codeExpected results
4016.9340169300
4016.9440169400
4016.9540169500
4016 991
40169900
4016 999
40170000
4017.0040170000
4101 .2
41012000
4101.5041015000
4101.9041019000
4017.40170000

<tbody>
</tbody>
 
Last edited:

Excel Facts

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


Excel 2010
AB
1ht coderesult
24016.9340169300
34016.9440169400
44016.9540169500
5401699140169910
6401699940169990
74017.0040170000
84101 .241012000
94101.5041015000
104101.9041019000
114017.40170000
Sheet5
Cell Formulas
RangeFormula
B2=SUBSTITUTE(SUBSTITUTE(A2,".","")," ","")&REPT(0,8-LEN(SUBSTITUTE(SUBSTITUTE(A2,".","")," ","")))
 
Last edited:
Upvote 0
How's this?


Excel 2010
AB
1ht coderesult
24016.9340169300
34016.9440169400
44016.9540169500
5401699140169910
6401699940169990
74017.0040170000
84101 .241012000
94101.5041015000
104101.9041019000
114017.40170000
Sheet5
Cell Formulas
RangeFormula
B2=SUBSTITUTE(SUBSTITUTE(A2,".","")," ","")&REPT(0,8-LEN(SUBSTITUTE(SUBSTITUTE(A2,".","")," ","")))

Thanks working as a charn
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

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