This is a workplace problem dressed up as a spreadsheet question. And the spreadsheet trick that gets asked for is clever, but it's solving the wrong problem. The real issue isn't the cell logic, it's that one person has to resort to guerrilla programming to manage a coworker conflict that their boss refuses to handle directly.
The request is technically specific: write a formula that clears one cell when another gets filled in the same column. That is doable. A bit of conditional logic or an OnEdit script could silently wipe the night-shift entry if both names appear on the same date. No error message, no drama. Just a blank cell that forces the boss to stop and find a replacement. It is passive resistance encoded in a spreadsheet. And it would probably work once or twice before the boss notices the pattern and either gets annoyed or asks what is going on. At that point the employee either has to explain the code or admit they are engineering the schedule behind the boss's back. Neither path ends cleanly.
What we see here is a person who is competent enough to imagine a workaround but still stuck in a system where the manager has not earned the trust to hear the real complaint. The night shift pairing is a human problem, friction, dread, maybe safety concerns. Excel is just the tool that surfaces it. The employee is asking for a formula when what they really need is a five-minute conversation: "I can't work night shifts with that person. Please schedule us separately." If the boss ignores that, the formula is a symptom of a broken management culture, not a solution.
Our take is simple: use the spreadsheet to document the pattern, not to hide it. Keep a log of every night shift where you and the coworker are paired. Show the boss the dates. If the request is dismissed, then the conversation moves from a scheduling preference to a workplace issue that deserves escalation. The formula is a clever patch, but it treats the spreadsheet as the enemy. It is not. The boss is the one who needs to pause and think again. Save the scripting for something that actually empowers you.