{"id":"data2-formula-email-domain-extract","audience":"marketing","category":"spreadsheets","track":"data","technique":"constraints","level":"beginner","title":"Write a formula that pulls the company name from an email","free":false,"task":"Your marketing list has an email column and you want just the company name in column B: the text between the @ and the first dot after it. Ask for one Excel formula for B2 in a single code block, then one line starting 'Example:' showing what it gives for one of the rows, under 8 words outside the code. The name must be lowercase, and a row with no @ should show Invalid.","materialLabel":"Your sheet (attached to your prompt automatically)","material":"Sheet: Leads (Excel)\n\nA Email | B Company\nMaya.Chen@Brightwave.COM |\nt.okoye@harborlogistics.example |\ninfo@fernhill-foods.example |\nsam at oakridge dot example |\nLEO@Ridgeway.example |\n\nNotes:\n- About 2,000 rows, rows 2-2001.\n- Some addresses are typed with capital letters.\n- One row has the @ spelled out as \"at\" and can't be used.\n- Domains can contain hyphens, and every domain in this list has exactly one dot.\n- Example: info@fernhill-foods.example has the company name fernhill-foods.\n- Excel 2016.\n- The list came from a trade-show badge scanner and a web form, which is why the typing is so inconsistent.\n- The domain column will feed a pivot table that counts leads per company, so \"Brightwave.COM\" and \"brightwave.com\" must come out identical.\n- Leads with no usable email will be removed by a filter on the word Invalid.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":8}],"mistakes":[{"title":"Leaving the capitals","why":"The result keeps Brightwave.COM exactly as typed.","fix":"Add: \"Take the text between the @ and the first dot, and wrap it in LOWER.\"","checks":["r0"]},{"title":"Errors on bad rows","why":"The row with no @ shows #VALUE!.","fix":"Add: \"If there is no @, return Invalid.\"","checks":["r1"]},{"title":"Forgetting the example line","why":"The AI explains in a paragraph instead.","fix":"Add: \"Then one line: Example: <email> -> <result>. Nothing else.\"","checks":["r2"]},{"title":"Leaving the format to chance","why":"The AI picks its own length and layout unless told the exact shape.","fix":"Add: \"Put the code in exactly 1 code block. Keep the writing outside the code under 8 words.\"","checks":["codeBlocks","maxProseWords"]}],"promptHints":[{"label":"Names the functions","patterns":["find","search","mid","right"]},{"label":"Asks for lowercase","patterns":["lower"]},{"label":"Handles no @","patterns":["invalid","iferror"]},{"label":"Asks for the example line","patterns":["example:"]},{"label":"Limits the output","patterns":["single code block","nothing else","one formula"]}],"hint":"Small formulas still need edge cases. Say lowercase, the invalid case and the format of the example.","mission":"Get the company name from an email in Excel.","musts":["One formula","Lowercase domain","Invalid when no @"],"rubricLabels":["The formula finds the @ with FIND or SEARCH and takes the text after it with MID, ending at the first dot after the @ (so the .com or .example ending is left out)","The formula wraps the result in LOWER so Maya.Chen@Brightwave.COM gives brightwave","The formula returns Invalid when there is no @ (for example IFERROR(...,\"Invalid\")), and the reply has a line starting 'Example:'"]}