It's fine. Duplicate check is processed before formula. Use API Before-Save script for custom duplicate checking.