How to create a Row-Level Formula for Days Elapsed in a Quarter:
Use a Row-Level Formula to display the Number of Days Elapsed in a Quarter on a Report.
Here are the instructions for creating a row-level formula to calculate the number of days between the start of the quarter and the close date within the same quarter.
Step1. Login to your Salesforce account
Step 2. In the navigation bar at the top, click on the App Launcher and search for Reports. Click on the Reports
Step 3. From the Reports tab, click New Report
Step 4. Select the Opportunities report type for the report, and click Start Report
Step 5. Save the report with a name of your choosing
Step 6. From the Columns section of the Outline pane, click | Add Row-Level Formula
Step 7. From the Edit Row-Level Formula Column window, enter a Column Name (2), choose a Formula Output Type of Number (3), set the number of Decimal Points to 0 (4), and use the Formula below (See Sample Formulas) (5). To test your formula for errors, click Validate. If necessary, resolve any errors. Then, click Apply (6).
Sample Formulas:
CLOSE_DATE - IF( MONTH(CLOSE_DATE) < 4, DATE( YEAR(CLOSE_DATE), 01, 01), IF( MONTH(CLOSE_DATE) < 7, DATE( YEAR(CLOSE_DATE), 04, 01), IF( MONTH(CLOSE_DATE) < 10, DATE( YEAR(CLOSE_DATE), 07, 01), DATE( YEAR(CLOSE_DATE), 10, 01) )))
Note: This version does not include the first IF statement like the formulas below because there is no need to check if the month is less than 1, as it would always evaluate to false.
CLOSE_DATE - IF( MONTH(CLOSE_DATE) < 2, DATE( YEAR(CLOSE_DATE) - 1, 11, 01), IF( MONTH(CLOSE_DATE) < 5, DATE( YEAR(CLOSE_DATE), 02, 01), IF( MONTH(CLOSE_DATE) < 8, DATE( YEAR(CLOSE_DATE), 05, 01), IF( MONTH(CLOSE_DATE) < 11, DATE( YEAR(CLOSE_DATE), 08, 01), DATE( YEAR(CLOSE_DATE), 11, 01) ))))
CLOSE_DATE - IF( MONTH(CLOSE_DATE) < 3, DATE( YEAR(CLOSE_DATE) - 1, 12, 01), IF( MONTH(CLOSE_DATE) < 6, DATE( YEAR(CLOSE_DATE), 03, 01), IF( MONTH(CLOSE_DATE) < 9, DATE( YEAR(CLOSE_DATE), 06, 01), IF( MONTH(CLOSE_DATE) < 12, DATE( YEAR(CLOSE_DATE), 09, 01), DATE( YEAR(CLOSE_DATE), 12, 01) ))))
Step 8. To save and run the report, click Save & Run
You're Done!
See Also:
Build a Report in Lightning Experience
Write a Row-Level Formula
Get the Most Out of Row-Level Formulas: Tips, Limits, and Limitations
000395525

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.