Need formula to put a space in postcode cell

BoldB

New Member
Joined
Apr 20, 2013
Messages
16
Hi,

Is there a formula that can look to see if there is a space in the data in a cell and if there is not, insert a space 3 digits from the end.

So the postcodes TA1 2BN and LS12 8PO would be left as they are and TA12BN and LS128PO would become TA1 2BN and LS12 8PO?

So the table would end up like this:

Data Formula
TA1 2BNTA1 2BN
LS12 8POLS12 8PO
TA12BNTA1 2BN
LS128POLS12 8PO

<tbody>
</tbody>


Kind Regards
Steven

<tbody>
</tbody>
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hey,
Thanks for writing!

You can use the following formula:
=IF(IFERROR(FIND(" ",A2)>0,0),A2,REPLACE(A2,LEN(A2)-2,0," "))

Change the referencing as per the requirement.

Hope this will help,

Raj
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,575
Members
449,039
Latest member
Arbind kumar

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