Eureka! Sometimes you have to use your noodle to come up with the answer. OK, that was just a figure of speech, but the real problem was that I had the wrong formula which I knew, but I did not
know why! I was getting my formula by looking at the XML after it was already inserted which in some cases is okay, but not in others. So, I thought I would try to use the formula how you enter it
into the UI which is the same as the FormulaDisplayNames value. I think Eric might have said that but I missed it if so! Anyhow, this worked and now I can finish writing the code to update the list.
This code is supporting a fix to allow the OOB 2007 SharePoint calendar the ability to show a 5 day work week. It is complex, but it seems to work so far!
nfields += "<Fields><Method ID='1'><Field Type='Calculated' DisplayName='DayCount' Format='DateOnly' ResultType='Text' ReadOnly='TRUE' Name='DayCount'>";
nfields += "<Formula>=DATEDIF([Start Time],[End Time],'d')</Formula>";
nfields += "<FormulaDisplayNames>=DATEDIF([Start Time],[End Time],'d')</FormulaDisplayNames>";
nfields += "<FieldRefs><FieldRef Name='EndDate' /><FieldRef Name='EventDate' /></FieldRefs></Field></Method></Fields>";