Library › Coding AI › Office and admin
Set due dates five business days out, skipping holidays
Practice: Giving the right context. About 5 minutes.
About this exercise
Write the formula for Requests!E2 (filled down) that sets the due date 5 business days after the received date in C2, skipping weekends and the company holidays listed on the tab named Holidays in A2:A15. Rows with no received date must stay blank. One formula in one code block, then under 25 words outside the code.
Common mistakes when you ask AI for this
- Leaving "a week" vague. The AI adds 7 calendar days, which ignores weekends and holidays. Try: Add: "5 business days with WORKDAY."
- Not pointing at the holiday list. The AI types holiday dates into the formula or skips them. Try: Add: "Holidays are on the Holidays tab, A2:A15."
- Forgetting empty rows. A blank date turns into a due date in January 1900. Try: Add: "If C2 is empty, leave E2 blank."
- Getting a menu of options. The AI likes to offer two or three versions of the formula, so you're left to pick and test them yourself. Try: Add: "Give one formula only, in one code block, no alternatives."
- Getting a tutorial. By default the AI explains every part of the code at length, which you then have to scroll past. Try: Add: "After the code, one line under 10 words. Nothing else."
What a strong prompt includes
- Says business days
- Points at the holiday list
- Handles blank dates
- Asks for one answer only
- Limits the explanation
Related exercises
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add dark mode by overriding your existing CSS variables (Coding AI · Software developers)
- Add input checks to your number guessing game (Coding AI · High school students)
- Add input validation to a Java method with exact messages (Coding AI · Software developers)
- Add labels to a signup form without rewriting the page (Coding AI · High school students)