Extract names, emails, or codes in Excel

Автор: AILesson5 мин на настройкуПроверено на:ChatGPTПроверено: 2026-08-28

Быстрый ответ

Build a text formula from real delimiters without assuming every row has the same shape. Укажите: Text to extract, Observed input patterns, Excel version and rules. Ожидаемый результат: A robust extraction formula with malformed-input checks.

1

Добавьте контекст

ваш текст остаётся в этом браузере. AILesson Prompts не отправляет его ни в модель, ни на сервер.

2

Ваш промпт

Незаполненные поля остаются видимыми как заполнители, поэтому вы всё равно можете скопировать и отредактировать промпт

Create an Excel formula to extract text.

Desired result:
[goal]

Observed input patterns:
[patterns]

Excel version and exception rules:
[version]

Identify the delimiter or positional rule and test whether it is stable across the supplied values. Do not assume all names have two words or all codes have fixed length unless stated. Return a modern formula, a legacy-compatible alternative when relevant, and tests for missing delimiters, repeated delimiters, leading/trailing spaces, blanks, and non-ASCII text. Keep malformed values visibly flagged rather than silently truncating them.
Попробовать в Playground
Конфиденциально по умолчаниюПромпт собирается локально в вашем браузере. Не вводите конфиденциальную информацию в сервисы ИИ, если ваша организация этого не разрешает.

От исходных данных к результату

Разобранный пример

Посмотрите, как конкретный контекст превращает этот рецепт в полезный результат

Реальный ввод

Text to extract
From A2 values formatted as 'Full Name <email>', extract the email into B2.
Observed input patterns
Normal: Ana Pérez <ana@example.com>; Chinese name: 王小明 <xiaoming@example.cn>; leading spaces; blank; malformed value without angle brackets; one row contains two '<' characters.
Excel version and rules
Microsoft 365 supports TEXTBEFORE and TEXTAFTER. Blank input should stay blank. Any malformed value should return 'Review'.

Пример вывода

The stable rule is text between one “<” and the following “>”. Because repeated delimiters are considered malformed, count them before extracting.

B2 formula =IF(TRIM(A2)="","",IF(AND(LEN(A2)-LEN(SUBSTITUTE(A2,"<",""))=1,LEN(A2)-LEN(SUBSTITUTE(A2,">",""))=1),TRIM(TEXTBEFORE(TEXTAFTER(A2,"<"),">")),"Review"))

The two length differences count opening and closing brackets. Only one of each allows extraction; TRIM removes surrounding spaces without changing accented or Chinese characters.

Legacy approach: use MID with FIND after the same bracket-count checks: TRIM(MID(A2,FIND("<",A2)+1,FIND(">",A2)-FIND("<",A2)-1)).

Tests: Ana Pérez and 王小明 return their full email addresses; blank returns blank; missing brackets and two opening brackets return Review. Also verify that “>” occurs after “<”; if reversed brackets exist in the data, add that condition before rollout.

Почему это работает

  1. 1

    Observed patterns prevent a formula designed for one clean example from corrupting irregular rows.

  2. 2

    A visible malformed-input result makes later cleanup auditable.

Проверьте результат

  • Does the extraction rule rely on a delimiter that is actually stable?

  • Are missing or duplicated delimiters reported rather than misparsed?

  • Does the formula preserve accents and non-Latin characters?

Используйте уверенно

Часто задаваемые вопросы

Практические ответы о том, когда использовать этот рецепт, что нужно предоставить и где по-прежнему важна проверка человеком

What should I prepare before using “Extract names, emails, or codes in Excel”?

For “Extract names, emails, or codes in Excel,” prepare Text to extract, Observed input patterns, and Excel version and rules. Replace placeholders only with information you can verify. If a detail is unknown, preserve that uncertainty explicitly instead of asking the model to infer it.

When is the “Extract names, emails, or codes in Excel” result not ready to use?

The result is not ready if it does not yet deliver the stated outcome—A robust extraction formula with malformed-input checks—from the supplied evidence, or if it relies on unresolved assumptions, missing approvals, or invented details. Use the checks as release gates: revise the source inputs or assign a named, authorized reviewer instead of polishing an unsupported output.

Which AI tools have recorded tests for “Extract names, emails, or codes in Excel”?

The published test record for “Extract names, emails, or codes in Excel” lists ChatGPT as of 2026-08-28. This confirms recorded runs, not guaranteed compatibility or identical results in later product versions. For another tool or version, keep every constraint visible and repeat the result checks before use.

Другие способы изучения

Где этот рецепт применим

Продолжайте работу

AILesson · Рекомендуемые курсы

ваш следующий шаг: примените ИИ на практике

Перейдите от понимания ИИ к выполнению задач. Практикуйтесь в составлении запросов, проверке и улучшении результатов с помощью интерактивных уроков для работы и повседневной жизни.

Просмотреть все курсы