Library › Coding AI › Finance and accounting
Label dates with a July-start fiscal quarter
Practice: Showing an example of what you want. About 5 minutes.
About this exercise
Write one Excel formula for Sales!F2 (filled down) that labels the date in B2 with its fiscal quarter. The fiscal year starts July 1 and is named for the calendar year it ends in, so October 14, 2026 is FY27-Q2. Quarters: Jul-Sep Q1, Oct-Dec Q2, Jan-Mar Q3, Apr-Jun Q4. Labels must look exactly like FY27-Q2 (two-digit year, hyphen). One formula in one code block, then under 25 words outside the code.
Common mistakes when you ask AI for this
- Not saying when the year starts. The AI uses calendar quarters, so October lands in Q4. Try: Add: "Fiscal year starts July 1 and is named for the year it ends."
- Not showing the label. The AI writes "FY2027 Q2" or "Q2 FY27", which breaks the pivot table. Try: Add an example: "October 14, 2026 is FY27-Q2."
- 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
- Gives the year start
- Shows the label
- Lists the quarters
- 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)