Hi,
I have a column with address details. I would like to separate the house number (always on the left) from the string. In some case, there might not be a house number, while in some other cases there might be a house and a flat number. I am only looking for the house number.
Table below, shows some sample data and the extracted columns I would like to have.
I have tried the following but I am not getting the intended results. Somehow it is pulling some letters as well.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Sample Data[/TD]
[TD]House #[/TD]
[TD]Address[/TD]
[/TR]
[TR]
[TD] 123 Main Street[/TD]
[TD]123[/TD]
[TD]Main Street[/TD]
[/TR]
[TR]
[TD]7 Jones Blvd[/TD]
[TD]7[/TD]
[TD]Jones Blvd[/TD]
[/TR]
[TR]
[TD]Super St[/TD]
[TD][/TD]
[TD]Super St[/TD]
[/TR]
[TR]
[TD]Market Road Flat 2[/TD]
[TD][/TD]
[TD]Market Road Flat 2[/TD]
[/TR]
[TR]
[TD]4567 Elm St #7[/TD]
[TD]4567[/TD]
[TD]Elm St #7[/TD]
[/TR]
</tbody>[/TABLE]
Thank you for any help.
I have a column with address details. I would like to separate the house number (always on the left) from the string. In some case, there might not be a house number, while in some other cases there might be a house and a flat number. I am only looking for the house number.
Table below, shows some sample data and the extracted columns I would like to have.
I have tried the following but I am not getting the intended results. Somehow it is pulling some letters as well.
Code:
=LEFT(S2,SUM(LEN(S2)-LEN(SUBSTITUTE(S2,{"0","1","2","3","4","5","6","7","8","9"},""))))
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Sample Data[/TD]
[TD]House #[/TD]
[TD]Address[/TD]
[/TR]
[TR]
[TD] 123 Main Street[/TD]
[TD]123[/TD]
[TD]Main Street[/TD]
[/TR]
[TR]
[TD]7 Jones Blvd[/TD]
[TD]7[/TD]
[TD]Jones Blvd[/TD]
[/TR]
[TR]
[TD]Super St[/TD]
[TD][/TD]
[TD]Super St[/TD]
[/TR]
[TR]
[TD]Market Road Flat 2[/TD]
[TD][/TD]
[TD]Market Road Flat 2[/TD]
[/TR]
[TR]
[TD]4567 Elm St #7[/TD]
[TD]4567[/TD]
[TD]Elm St #7[/TD]
[/TR]
</tbody>[/TABLE]
Thank you for any help.