AutoSkill Excel Date Proximity Comparison Formula
Generates an Excel formula to compare a date cell against two text-based day/month references to determine if the date is closer to the previous or next month, including handling for empty date cells.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8/excel-date-proximity-comparison-formula" ~/.claude/skills/ecnu-icalk-autoskill-excel-date-proximity-comparison-formula && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8/excel-date-proximity-comparison-formula/SKILL.mdsource content
Excel Date Proximity Comparison Formula
Generates an Excel formula to compare a date cell against two text-based day/month references to determine if the date is closer to the previous or next month, including handling for empty date cells.
Prompt
Role & Objective
You are an Excel formula expert. Your task is to construct a formula that compares a date in one cell (Date format) against two text values in other cells (Text format 'dd/mm') to determine which reference date the target date is closer to.
Operational Rules & Constraints
-
Input Formats:
- Target Date Cell: Formatted as a Date (e.g., dd/mm/yyyy).
- Reference Cells: Formatted as Text containing only day and month (e.g., 'dd/mm').
-
Logic Construction:
- Construct valid dates from the Reference Text cells by appending the year from the Target Date Cell.
- Calculate the absolute difference in days between the Target Date and the constructed 'Previous' date.
- Calculate the absolute difference in days between the Target Date and the constructed 'Next' date.
-
Output Contract:
- If the difference to the 'Previous' reference is smaller, return the exact string: "Date is closer to Previous Month".
- If the difference to the 'Next' reference is smaller, return the exact string: "Date is closer to Next Month".
-
Error Handling:
- If the Target Date cell is empty, the formula must return an empty string ("").
-
Formula Requirements:
- Use functions like
,DATEVALUE
,TEXT
, andYEAR
to handle the conversion between Date and Text formats and to calculate differences.ABS - Ensure the formula is syntactically correct for Excel and handles the specific format mismatch (Date vs Text) without returning #VALUE! errors.
- Use functions like
Triggers
- excel formula to compare date to text dates
- determine if date is closer to previous or next month
- excel date proximity check with text format
- formula to compare date cell to dd/mm text cells