AI & ChatGPT

How to Use the AI.EXTRACT Function in Excel (with Examples)

As a data analyst, sales operations professional, or marketer, you often encounter messy contact lists, unstructured customer feedback, or inconsistent text data in Excel. Manually cleaning and structuring this information to extract specific details like names, email addresses, or city names can be a time-consuming and error-prone task. This is where the powerful AI.EXTRACT Excel function comes in, offering an efficient, AI-powered solution to streamline your data preparation process.

AI for Excel course thumbnail showing AI.EXTRACT function in action
Recommended Course on JunoAI for Excel
View Course →

The Old Way vs. The AI Way of Extracting Text

Before the advent of advanced AI functions in Excel, extracting specific pieces of text from a larger string involved a series of complex, nested formulas. To perform tasks like extracting a name or email address, you would typically combine functions like FIND, MID, LEFT, RIGHT, and LEN. This approach was not only difficult to construct and debug but also brittle, often breaking if the text format varied even slightly. For instance, extracting an email might require finding the "@" symbol and then determining the start and end points for the username and domain, a process that quickly becomes unwieldy.

The AI.EXTRACT function, part of the new suite of AI for Excel functions, simplifies this dramatically. Instead of writing intricate logic, you simply tell Excel what you want to extract in natural language. This shift from rule-based extraction to intelligent, context-aware extraction saves significant time and reduces the likelihood of errors, making your data cleaning workflow much more efficient.

AI.EXTRACT Syntax Explained

The AI.EXTRACT function has a straightforward syntax, making it accessible even if you're new to AI-powered Excel tools:

=AI.EXTRACT(text, what_to_extract)

Example 1: Extracting Full Names from a Bio

Imagine you have a column with short bios or descriptions of contacts, and you need to populate a separate column with just their full names. Manually parsing each entry would be tedious. With AI.EXTRACT, it becomes a simple task.

Let's say cell A2 contains the text: "Experienced marketing manager, Sarah Smith, leads our digital campaigns."

To extract the name, you would use the formula:

=AI.EXTRACT(A2, "name")

Based on our experience, when using this function, we simply passed the input range and specified "name" as the desired extraction. The function intelligently identifies and returns "Sarah Smith", even though it's embedded within a longer sentence. This demonstrates how easily you can excel extract name from text without complex string manipulation.

Example 2: Pulling Email Addresses from Text

Sales and marketing teams frequently deal with text fields that might contain email addresses alongside other contact information. Isolating these email addresses is crucial for building clean mailing lists or CRM entries. This is another perfect use case for AI.EXTRACT.

Consider cell B2 containing: "For inquiries, please contact us at support@example.com or call 123-456-7890."

To extract the email address, you would enter:

=AI.EXTRACT(B2, "email")

As observed in practical applications, applying AI.EXTRACT to a cell and specifying "email" as the extraction target yields accurate results. The function successfully identifies "support@example.com" by recognizing the standard email format. This makes excel extract email from text a breeze, eliminating the need for regular expressions or convoluted formulas.

Example 3: Finding City Names in Addresses

Addresses can come in many formats, with the city name appearing at the beginning, middle, or end of the string. Extracting just the city name reliably across varied formats is a common data cleaning challenge.

Let's look at a few examples:

To extract the city name from any of these, you would use:

=AI.EXTRACT(C2, "city")

When applying this function for cities, the results come through accurately. A key benefit is that it does not matter if the city name is at the beginning, middle, or end of the sentence or address string. The AI intelligently pinpoints the city name, making it highly versatile for cleaning geographical data.

Troubleshooting and Tips

While AI.EXTRACT is a powerful tool, understanding its requirements and limitations can help you use it more effectively:

Ready to level up your career?

Join 5 lakh+ learners on the Juno app. Certificate courses in Hindi and English.

Get it onGoogle Play
Download on theApp Store