Phone Toolkit

Parse

PHONE_PARSE

Spills normalized formats, country, calling-code, type, valid, and possible columns.

Syntax

=PHONE_PARSE(phone_number, [default_country], [include_headers])

Parameters

Namephone_number
Typetext, number, or range
DescriptionPhone number text, numeric value, or a range containing phone numbers.
Namedefault_country?
Typetext
DescriptionTwo-letter country code used for numbers without a + country code, such as "US" or "GB".
Nameinclude_headers?
Typeboolean
DescriptionTRUE to add a header row above parsed results.

Returns

A spilled table with E.164, international, national, country, calling code, type, valid, and possible columns.

Example

=PHONE_PARSE(A2:A, "US", TRUE)

Result: E.164, International, National, Country, Calling Code, Type, Valid, Possible

Notes

Use a + country code in phone_number, or pass default_country as a two-letter country code such as US, GB, CA, AU, or IN.

Store numbers as text to preserve leading zeros and plus signs. Enter complete numbers, not prose containing numbers.

Validation checks bundled numbering-plan metadata, which may become outdated. It does not prove assignment, reachability, ownership, or SMS support. Possible checks length; valid also checks digit patterns.

E.164 output omits extensions. National, international and RFC3966 output preserve supported extensions. PHONE_PARSE flattens ranges in row order into eight columns.

Invalid option values, dates, booleans and unsafe numeric inputs throw native errors. Header options accept TRUE/FALSE, 1/0, or yes/no.

Range inputs are supported. Blank and whitespace-only cells are preserved; row, column and 2D orientation is retained. Use bounded ranges.

Parsing and formatting run locally inside the Google Apps Script™ bundle with no phone-number API calls.

Formatting and detail functions throw native spreadsheet errors for unparseable or invalid nonblank values; PHONE_VALID and PHONE_POSSIBLE return FALSE instead.

    xs