Apple Numbers Sort out Specific Area Codes From a List of Phone Numbers

I need to remove all area codes that are not 505 or 575

I am currently using an adapted formula from a different discussion


IF(AND(ISERROR(SEARCH("505",U12352,1)),ISERROR(SEARCH("575",U12352,1))),"BAD","GOOD")


However, a phone number like (123) 555-5056 is returned as good. Is there a way to limit the search to just the first 3 digits of the string?

Posted on Feb 13, 2024 6:23 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 13, 2024 6:50 PM

Consider using a Filter, like this:






You can put the results in another table by first setting up the destination table, then selecting the visible cells in the filtered table, typing command-c, clicking once in a cell of the destination table followed by command-v or Edit > Paste and Match Style.


There are other possible approaches such as using REGEX to match the first characters, but I the Filter should be by far the easiest in this case. Less than a minute and you're done, without writing a single formula.


Filter data in Numbers on Mac - Apple Support


SG


8 replies
Question marked as Top-ranking reply

Feb 13, 2024 6:50 PM in response to JNRG_Admin

Consider using a Filter, like this:






You can put the results in another table by first setting up the destination table, then selecting the visible cells in the filtered table, typing command-c, clicking once in a cell of the destination table followed by command-v or Edit > Paste and Match Style.


There are other possible approaches such as using REGEX to match the first characters, but I the Filter should be by far the easiest in this case. Less than a minute and you're done, without writing a single formula.


Filter data in Numbers on Mac - Apple Support


SG


Feb 13, 2024 7:28 PM in response to JNRG_Admin

JNRG_Admin wrote:

Can functions clear a cell?


You can use a formula to place a null character in a cell making it appear blank. So where you have "BAD" in a formula you could change that to "" and the result will appear blank.


You can place a filter on each column in turn.


You could also apply Conditional Formatting to highlight the bad ones (or good ones) in a specific color.


SG

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Apple Numbers Sort out Specific Area Codes From a List of Phone Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.