# Sum of a column based on different account codes

1. ## Sum of a column based on different account codes

I am trying to find the revenue generated by different groups of accounts to figure out which group is worth the most, and rank the others.

Here is a attached screenshot of what I am working with, cell BK22 is the revenue of all of the accounts coded AADA but i need to find an easier way other than plugging it in for all 3500 cells.

Thanks.

Screen Shot 2014-01-03 at 8.57.55 AM.jpg

2. ## Re: Sum of a column based on different account codes

Hi Tward

Welcome to the forum.

I think SUMIF is what you need. In the case of cell BK22, the formula would read:

=SUMIF(AZ:AZ,AZ22,BJ:BJ)

Enter the formula in to cell BK22 then copy it to the other cells in column BK.

Best regards, Rob.

Thanks man!

4. ## Re: Sum of a column based on different account codes

If I copy that cell into all of the remaining in column BK is there a way I can hide repeating account codes that way I don't have the same numbers repeating, and then easily unhide to see the accounts and information needed for each individual account?

5. ## Re: Sum of a column based on different account codes

Another way to do it is by using the subtotal feature under Data > Outline > Subtotal. Highlight all your data, as well as your headers, and select subtotal. You want at each change in Account, use function sum, Add subtotal to \$ secured.

This method will also let you hide and unhide all of the details, leaving you with a summary. Just hit the +/- buttons to the left of the data by the row numbers.

6. ## Re: Sum of a column based on different account codes

Cool deal man, thanks. It was probably a rookie task but needed some pointers! Thanks again.

7. ## Re: Sum of a column based on different account codes

David is correct. Subtotal may well suit you better.

If you want to stick with the SUMIF method, change the formula to:

=IF(AZ22=AZ23,"",SUMIF(AZ:AZ,AZ22,BJ:BJ))

Best regards, Rob.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1