Need Excel Formula to trim spaces before Numbers

raajnabriz

Board Regular
Joined
Jun 11, 2014
Messages
112
[FONT=&quot]Hi there,[/FONT]
[FONT=&quot]Please provide excel formula to trim spaces before numbers, i have received large data that contains spaces in each cell before the amount. I am using MS Office 2010.[/FONT]
[FONT=&quot]Thanks,[/FONT]
[FONT=&quot]Raaj.[/FONT]
 
When you trim, the numbers will still be in text format, try =TRIM()+0 to convert them back to numbers, then they should sum correctly.

Alternatively, select all of the cells with the amounts, then use find and replace (ctrl h), enter a single space in the Find box, leave the Replace box empty, then Repalce All.
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Thank you all for your gr8 effort in helping me out, I just received the required formula from a wonderful youtuber named Ms. Leila Gharani [thank you Ms. Leila].
 
Upvote 0
You also received the required answer here 3 days ago.

If the answer here was wrong then so was the question.
 
Upvote 0
You also received the required answer here 3 days ago.

If the answer here was wrong then so was the question.

Sorry Jason, I didn't mean to demean anyone of you there, but the correct formula that helped me was this

=VALUE(TRIM(SUBSTITUTE(A1,CHAR(160),CHAR(32))))

This not only trimmed the spaces but also helped in getting the sum total of selected cells on the status bar and that was what I had requested.

Sorry once again if may be my question was not thoroughly explained by me.

I have received many a good work from this forum since many years and I thank everyone for that.

Raaj.

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,217,188
Messages
6,135,101
Members
449,911
Latest member
Omarahmed99

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