It all depends on how standardized your data is, but if the numbers are always in the last positions as in your example:
AV NOSSA SENHORA DE COPACABANA 664
AV DOM SEVERINO
AV DOM HELDER CAMARA, 5332
R PROJETADA 05 S/N
ROD BA-526 305
You could use a set of functions to achieve what you want, something like that:
=SE(ÉERRO(VALOR(DIREITA(A1;CORRESP(" "; ÍNDICE(EXT.TEXTO(A1;NÚM.CARACT(A1)-LIN(INDIRETO("1:"&NÚM.CARACT(A1)))+1;1);0);0)-1)));"S/N";VALOR(DIREITA(A1;CORRESP(" "; ÍNDICE(EXT.TEXTO(A1;NÚM.CARACT(A1)-LIN(INDIRETO("1:"&NÚM.CARACT(A1)))+1;1);0);0)-1)))
This is the complete formula, see below how I got to this formula.
It is a little long the set of formulas... but it is simple, I will try to separate and explain to better understand:
Check the first space of right to the left, because by the data that provided the last characters are their numbers, and some have "S/N" others are without any number, so would be:
=CORRESP(" "; ÍNDICE(EXT.TEXTO(A1;NÚM.CARACT(A1)-LIN(INDIRETO("1:"&NÚM.CARACT(A1)))+1;1);0);0)
This is the most difficult formula to actually understand.
Search data from right to left after last blank:
=DIREITA(A1;[FÓRMULA DO ITEM 1 AQUI]-1)
Replace what is between [ ] (brackets) by the formula of item 1.
Verirfica if this result (item 2) is a number and returns that number or returns a text ("S/N" in the case):
=SE(ÉERRO(VALOR([FÓRMULA DO ITEM 2 E 1]));"S/N";VALOR([FÓRMULA DO ITEM 2 E 1]))
Replace what is between [ ] (brackets) by the formula of item 2 and item 1 to have the complete formula.
Do a test with the complete formula on a flatten having the address in cell "A1" and you will see that it works.
I hope I’ve helped!
it is possible to pass the spreadsheet to csv ? if yes, you can use the Notepad++ which is much simpler to do
– Rovann Linhalis