I would agree that Salesforce metrics and KPIs can feel more like Art than Science, but I will say that over the past few years, Salesforce has provided more and more tools to parse data and get to the metrics that are important to your business, if you know where to look, and what to use. Such tools include:
Anyway, I was recently asked to calculate a Closed Won Opps Quarter-to-Date Weekly Average and Closed Won Total by Sales Rep for a client. How are we going to do that? Essentially we need the sum of amount plus the correct week of the quarter (we'll solve the problem of first six days in the quarter in a second).
Being the not-reinvent-the-wheel kind of guy I am, I quickly googled 'salesforce calculate week of the quarter formula.' After digging for a few minutes, I found this discussion thread on developerforce.com asking for "help help writing formula to display Week number." Bingo! Not exactly what I wanted, but very close. I read through the thread and found a bit of formula written by Super Contributor, Steve Mo (over 26,000 Answers and 1700 Best Answers! Go Steve!), which calculates Week Number in the year based upon a date field (for my formula, I used TODAY() in place of Steve Mo's Testing_Date__c):
CEILING(((Testing_Date__c - DATE(YEAR(Testing_Date__c), 1, 1) + 1) +
MOD(DATE(YEAR(Testing_Date__c), 1, 1) - DATE(1900, 1, 7), 7)) / 7)
Okay, now that we have the week of the year, we can use a Case formula to determine the week in the quarter:
1,AMOUNT:SUM/1,
2,AMOUNT:SUM/2,
3,AMOUNT:SUM/3,
4,AMOUNT:SUM/4,
5,AMOUNT:SUM/5,
6,AMOUNT:SUM/6,
7,AMOUNT:SUM/7,
8,AMOUNT:SUM/8,
9,AMOUNT:SUM/9,
10,AMOUNT:SUM/10,
11,AMOUNT:SUM/11,
12,AMOUNT:SUM/12,
13,AMOUNT:SUM/13,
14,AMOUNT:SUM/1,
15,AMOUNT:SUM/2,
16,AMOUNT:SUM/3,
17,AMOUNT:SUM/4,
18,AMOUNT:SUM/5,
19,AMOUNT:SUM/6,
20,AMOUNT:SUM/7,
21,AMOUNT:SUM/8,
22,AMOUNT:SUM/9,
23,AMOUNT:SUM/10,
24,AMOUNT:SUM/11,
25,AMOUNT:SUM/12,
26,AMOUNT:SUM/13,
and so on...
Finally, in order to account for the first six days of the quarter, IF MONTH(TODAY()) = 1,4,7,10 AND DAY(TODAY()) = 1,2,3,4,5,6, THEN AMOUNT:SUM, ELSE combine Steve Mo's week of the quarter plus my CASE addition equals Closed Won Average per week Quarter-to-Date.
Image: John Baumgart [Public domain, GFDL (http://www.gnu.org/copyleft/fdl.html) or CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons