Hello All,

I am trying to validate a Canadian postal code in excel code. I am able to validate the code for the letters and numbers, example: e3r4t5. However I am trouble in creating a formula that is short enough to add a space between the e3r and 4t5.

my code is: =(LEFT(K21)>="A")*(LEFT(K21)<="Z")*(MID(K21,2,1)>="0")*(MID(K21,2,1)<="9")*( MID(K21,3,1)>="A")*(MID(K21,3,1)<="Z")*(MID(K21,4,1)>="0")*(MID(K21,4,1)<="9 ")*(MID(K21,5,1)>="A")*(MID(K21,5,1)<="Z")*(MID(K21,6,1)>="0")*(MID(K21,6,1) <="9")*(LEN(K21)=6)

Is there anyway to shorten this code to add a space between the third and fourth character?

Thank you.