Check Postcode for Correct Character Zero (0) and not Letter (O)

razzandy

Active Member
Joined
Jun 26, 2002
Messages
400
Office Version
  1. 2007
Platform
  1. Windows
Hi Guys, so I have the below Formula where it correctly formats a postcode but now I need it to check the Characters to make sure a Zero (0) is in fact a zero and not a Letter (o)? So a UK Postcode example could be BL1 oLL, so the 'o' in this example would need changing to Zero. As you can imagine it gets more complicated with longer/shorter postcodes! UK postcode formats can be found here: Postcodes in the United Kingdom - Wikipedia.

Excel Formula:
=UPPER(REPLACE(SUBSTITUTE(B5," ",""),LEN(SUBSTITUTE(B5," ",""))-2,0," "))

Thanks in advance! (y) 🙏
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Can't you just Replace all Os with 0s?
=SUBSTITUTE(B5,"O",0)

and perhaps for the whole thing:
=REPLACE(SUBSTITUTE(SUBSTITUTE(B5," ",""),"O",0),4,0," ")
 
Upvote 0

Forum statistics

Threads
1,223,882
Messages
6,175,166
Members
452,615
Latest member
bogeys2birdies

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