Hello, when I read the first part of your question "... if(isnull(Year) = -1 then set the year = 2010 ...", that is translated as: if(isnull(Year),2010) But you probably want to keep the non null values, which gives: if(isnull(Year),2010,Year) From your explanation, I do not understand why the "sum" appears in your formula. Greetings, Piet