Does this work for you?
Let ([
// test input. Put your real input here:
~serial = "12345P382M45" ;
~stripped = Right ( ~serial ; Length ( ~serial ) - 6 ) ;
~letter = Left ( Filter ( ~stripped ; "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM" ) ; 1 ) ;
~pos = Position ( ~stripped ; ~letter ; 1 ; 1 ) ;
// I'm not sure what you want to happen if there are no letters
// but this will return EVERYTHING after the first 6 digits in
// the absense of letters(~pos == 0)
~res = If (
~pos > 0 ;
Left ( ~stripped ; ~pos - 1 ) ;
~stripped
)
];
GetAsNumber ( ~res )
)