Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all, I have a spreadsheet with rows of information separated by a blank row. The number of rows will be variable each month. I need to sum a column for each of that number of rows and copy past to another worksheet in the same workbook. My issue is that I do not know the code to sum the rows down to the blank row. Can you help me?

If I understand your question correctly, try:
=SUM(StartCell:EndCell)
=SUM(A1:A9)
Excel counts blank or empty cells as Zero.

If I understand your question correctly, you have blocks of data such as this:
A1:A3
A5:A10
A12:A16Have you considering using Named Ranges?
For example, if you give A1:A3 a name, such as Group1, you can use SUM(Group1) to get your total. If you insert a row between A1 and A3, Group1 will now include that row.
As long as you don't add a row before A1 or after A3, the row will become part of the named range.
If you think you'll need to add rows at the beginning or end of the Named Range, see this site for tips on creating Dynamic Named Ranges that will change size based on the criteria used:

Unfortunately each range is a different cost centre and will vary each month depending on the number of jobs done. This is a table extracted from MYOB and so there is no formating. The only division between each cost centre is a blank row. I thought that I might be able to copy the name of each cost centre down and stop at the blank row but this is difficult because the number of rows changes each month. Any ideas are most welcome.

Sorry...
I extracted a table in MYOB which provides the profit from each job. The jobs are dated and collected under 9 cost centres. Each group is separated by a blank row. What I am trying to do is report the profitability of each cost centre by month. The only link I have is that there is a "Name" column and each group has a "Name" at the top and a "Name 1" at the bottom with a list in the middle. Next is a blank row followed by the next group "Name", a list and "Name1" and so on.
The more detail I provide the more difficult it sounds.Sorry

Actually, it might be better if you provided some detail related to the Name and Name1 you mentioned.
Please provide an example of 2 groups of data so we can the beginning, the list and then the end of each. There maybe something we can do with the Name column.
I know that we can use VBA to sum each group between the blank lines, but I'd like to see if a formula could be used. In any case, I'd need to see some example data befre I could offer any code.

The column titled Job Number has 9 sun headings. eg DM DOM underwhich are the job numbers 1001/09, 1002/09 etc followed by DM DOM1 and then a blank row followed by CW DOM the job numbers 1012/09, 1013/09 etc followed by CW DOM1. Each job number has Net Profit and Finish Date. The outcome I am after is the Profit (Sum) of each of the headings by month. Hope this helps. J

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |