Ah, I think it was because you had a typo in your original formula (which is what I was working off of).
You had it returning F12, not D12. Here was your original formula:
Code:[COLOR=#333333]IF(isblank(D12),(F17<365,F27,IF(F17>364,F37,[/COLOR][COLOR=#ff0000]f12[/COLOR][COLOR=#333333])))[/COLOR]
So if it is really D12 we want at the end and not F12, then simply change the last value in my last formula:
Code:=IF(ISBLANK(D12),IF(F17<365,F27,F37),[COLOR=#ff0000]D12[/COLOR])