You need to sign in to do that
Don't have an account?

Formula Not working - why?
Ok, I'm working with a custom formula to calculate the actual working days per month. The key to everything is the Date Seen field ("Date_Seen__c")... Everytime one of our counselors sees an employee, they populate the Date Seen field. There is a formula that runs off of this field that basically calculates a "1" for every date seen IF( NOT(ISNULL(Date_Seen__c)) ,1, 0).
That all works just fine.
Now, what is being asked of me is to calculate the number of employees see per working a day of each month. For instance, if our counselor John Smith saw 100 employees in a month, and there were 20 working days per month, that would be an average of 5 per day. So I told the system what number of working days to calcuate for each month with this formula:
IF(AND(MONTH(Date_Seen__c)=1,YEAR(Date_Seen__c)=2007 ),22,
IF(AND(MONTH(Date_Seen__c)=2,YEAR(Date_Seen__c)=2007 ),20,
IF(AND(MONTH(Date_Seen__c)=3,YEAR(Date_Seen__c)=2007 ),22,
IF(AND(MONTH(Date_Seen__c)=4,YEAR(Date_Seen__c)=2007 ),21,
IF(AND(MONTH(Date_Seen__c)=5,YEAR(Date_Seen__c)=2007 ),22,
IF(AND(MONTH(Date_Seen__c)=6,YEAR(Date_Seen__c)=2007 ),21,
IF(AND(MONTH(Date_Seen__c)=7,YEAR(Date_Seen__c)=2007 ),22,
IF(AND(MONTH(Date_Seen__c)=8,YEAR(Date_Seen__c)=2007 ),23,
IF(AND(MONTH(Date_Seen__c)=9,YEAR(Date_Seen__c)=2007 ),19,
IF(AND(MONTH(Date_Seen__c)=10,YEAR(Date_Seen__c)=2007 ),23,
IF(AND(MONTH(Date_Seen__c)=11,YEAR(Date_Seen__c)=2007 ),20,
IF(AND(MONTH(Date_Seen__c)=12,YEAR(Date_Seen__c)=2007 ),20, null
)
)
)
)
)
)
)
)
)
)
)
)
IF(AND(MONTH(Date_Seen__c)=2,YEAR(Date_Seen__c)=2007 ),20,
IF(AND(MONTH(Date_Seen__c)=3,YEAR(Date_Seen__c)=2007 ),22,
IF(AND(MONTH(Date_Seen__c)=4,YEAR(Date_Seen__c)=2007 ),21,
IF(AND(MONTH(Date_Seen__c)=5,YEAR(Date_Seen__c)=2007 ),22,
IF(AND(MONTH(Date_Seen__c)=6,YEAR(Date_Seen__c)=2007 ),21,
IF(AND(MONTH(Date_Seen__c)=7,YEAR(Date_Seen__c)=2007 ),22,
IF(AND(MONTH(Date_Seen__c)=8,YEAR(Date_Seen__c)=2007 ),23,
IF(AND(MONTH(Date_Seen__c)=9,YEAR(Date_Seen__c)=2007 ),19,
IF(AND(MONTH(Date_Seen__c)=10,YEAR(Date_Seen__c)=2007 ),23,
IF(AND(MONTH(Date_Seen__c)=11,YEAR(Date_Seen__c)=2007 ),20,
IF(AND(MONTH(Date_Seen__c)=12,YEAR(Date_Seen__c)=2007 ),20, null
)
)
)
)
)
)
)
)
)
)
)
)
Then I ran a formula that says EE_SN__c / TT_Days_In_Month__c
I'm grouping the reports to group by month - but it doesn't calculate by the number I'm assigning. For instance, in August, it's dividing by 25, and for June and July it's calculating by 20. What am I doing wrong?
Any help would be really really appreciated. :)
For instance, I am not sure where the Date Seen field resides. Is it in a detail record, or a related list object related to an employee? I need a little more background on this.
Another instance is in the long if/and formula it is in a custom formula field, correct?
Lastly, where was the EE_SN__c / TT_Days_In_Month__c formula run from? The report or in another custom field?
Overall the logic makes sense, we just need to figure out where we need to tweak things.
Oh, I found something you may wish to use while looking through the formula field help section. It is a custom formula that returns the Month based on a date field. You could easily change that to show work days instead. Also, you could then add to it a little easier when you need to have multiple years (as you know they will want this report next year too! :smileyhappy:)
CASE( MONTH(Date_Seen__c) ,
1, "January",
2, "February",
3, "March",
4, "April",
5, "May",
6, "June",
7, "July",
8, "August",
9, "September",
10, "October",
11, "November",
12, "December",
"None")
Kevin
i appreciate your advice:
All of the fields and formulas are in a custom object we call Benefit. It is linked to another Custom Object, called Employee. This includes the EE_SN_c/TT_Days_In_Month_c
I can try the formula you are suggesting, althought I'm a little confused on how that it would be different from the formula I already wrote for TT_Days_In_Month. Can you explain that to me, or write a quick sample for one or two months?
Thanks.
Here is how I would set the formula up:
AND(Year(Date_Seen__c)=2007,
CASE( MONTH(Date_Seen__c) ,
1, 22,
2, 20,
3, 22,
4, 21,
5, 22,
6, 21,
7, 22,
8, 23,
9, 19,
10, 23,
11, 20,
12, 20,0)
)
Kevin
Kevin
Simple enough - it worked! Unfortunately, I've tried using the round formula so that it doesn't have to be 6 decimal points on my reports, but it always seems to round down. :(
Either way, I'm just happy to have it calculating correctly! Thanks for your help!