Fetch the middle name from the Name

Formula if 3 number area code or 4

Yes, it is possible. You can use LEFT function for the same.

Formula: LEFT(phone number, no. Digits to be included)

Example: ({Mobile No.},3), suppose +123972501595 is the mobile number
Result: It will automatically fetch 123 from the field, which you can name as Country Code.

This formula will extract the number of digits you want, plus you can use the above to extracting names as well.