This equation takes a phone number with area code and strips the 7 numbers after the area code, leaving only the area code:

=LEFT(TEXT(E1,"0"),LEN(TEXT(E1,"0"))-7)

You can change the variables to clip and prune whatever info off either side of a number to get what you need.