...
AND(DATEVALUE(CreatedDate)<DATE(YEAR(DATEVALUE(CreatedDate)),MONTH(TODAY()),1),DATEVALUE(CreatedDate)>=DATE(YEAR(DATEVALUE(CreatedDate)),1,1))
Things you can't do
- You can't do a roll up summary field on a formula field!!!! https://success.salesforce.com/ideaview?id=08730000000Bra0AAC (caveat - if it has cross object formulas - seehttp://blog.wdcigroup.net/2012/07/salesforce-tips-roll-up-summary-with-formula-fields/) Workarounds:
- Use Rollup Helper.
- Use workflows to update a the field on the child object, then you can sum it. http://focusonforce.com/configuration/salesforce-roll-up-summary-using-the-value-of-a-formula-field/
- Don't use cross object formulas in the child object
- Flows
- Process builder?
Rules
Rules for Formulas:
- Use Comments - See Trailhead for an example https://developer.salesforce.com/trailhead/force_com_introduction/point_click_business_logic/formula_fields
- Space out your formulas so you can read them.
- eg each section of an AND formula on a new line
- See Enhanced Formula Editor in Useful Google Chrome Extensions for Salesforce to see how to show your formulas in colour.