Example: Accounts with Opportunities report

How do you add a count of the Accounts listed to such a report?? I have tried to no avail to find a solution for this WITHOUT exporting to Excel (or doing it with my finger and eyes).

John Doe
   Opp 1
   Opp 2
   Opp 3
Jerry Doo
   Opp 1
   Opp 2

...should return a count of "2" for the Accounts listed, not "5" for the Opps listed. :-(

1 Answer 1


This functionality is not available out of the box on a summary report. However, this is a workaround to get this to work on a summary report, although it technically isn't ideal. To do this, you will need to do the following.

First, add a new custom field to an account called Count. This field should be a formula for a Number with a value of 1, like such:

Account Custom Count Field

This field will be used as part of your report. Make sure that you have properly added this newly created custom field to the report type. If you do not add it there, it will not show up when you go to create the report.

Next, on your custom report, you will need to add a formula field. This formula field will be the sum of all Account Counts and will be displayed at the bottom of the page only. To do this, drag the Add Formula field under the Formulas folder on the left hand side of the report onto the report. Once you do that, you should get a popup to enter values. Those values should be entered as such:

Account Count Custom Formula Field

Save the field. Run the report. The result should look something like:

Report with Account Count

Notice how the new column is only displayed at the Grand Totals section of the report. Also notice how it only sums up the accounts that are displayed, correctly showing a count of two accounts while there are actually three opportunity records in the report. Unfortunately, there is the added column on the right hand side of the report and the count at the bottom of the page doesn't have a label. There isn't really anything you can do about that right now. The good news is that you can now see the Account Count without exporting to Excel.

Please take some time to visit the Ideas site and vote for this functionality to be added to Salesforce as part of the base functionality.

  • This is the answer needed - thanks. I WILL promote it on the Ideas site for sure. Thankfull this works with Matrix just as well, too.
    – AMM
    Feb 4, 2013 at 16:44
  • This is not working can you please help for this
    – user10298
    Jul 8, 2014 at 9:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .