Inserting a “–” or a “0” using REGEX?
The format of the British outward postcode is AA for the Area and 99 for the District.
Most outward postcodes have the format AA99.
However some postcodes have either the format A99 or the format AA9.
For sorting and searching purposes the formats A99 and AA9 have to be “adjusted” (extended) to A–99 and AA09.
When the postcode format is entered as AA99, then get the postcode as entered: AA99
When the postcode format is entered as A99, then insert a “–“ after the first letter: A–99
When the postcode format is entered as AA9, then insert a “o“ after the second letter: AA09
The first table contains the ranges of British postcodes, 66 rows in total (only a selection is shown).
The second table looks up the first table for either GB✷1 or GB✷2 based on the entered postcode.
As an example, entering the postcode HP7 in the second table results in GB✷1 after searching the first table.
My question: is it possible to replace the 4 formulas in the cells D3, E3, F3 and G3 of the second table with a simple formula in 1 cell based on REGEX?
Paul.
iMac 27″, macOS 10.14