Hello, I have question about how to add rows with subotal and sum formulae in an excel list.
I have a database with names of employees working in various sections. Each Section has subsections who are run by managers and staff is working for them.
In the following example we have the following:
Column A shows the "position code", which is a code assigned to each "position". This code is handwritten, not automated. It is intended to show hierarchy of position.
Column B shows the "position" where each employee works.
Column C shows the count of staff that work in each "position". The actual staff is shown more clearly in column D, where you can see the numbers and the summing formulae.
For example rows 7, 8, 11, 12 all contain a summing formula or a subtotal formula.
In cell A3 I have the value "1", which is shown when I apply filters to the list. Because I use a lot of different filters in various columns (actually the whole list has more than 25 columns), I need the two different formulae in each summing row: ie to subtotal one and the sum one.
So far I have hardcoded each formula in each row. But I need to make this list more dynamic. I cannot use a pivot due to the various filters I need to apply and new data I show using vba.
Important thing to note is that I am using excel 2003 since I have not been able to upgrade my code as it presents many errors. The code also works well in excel 2007 but that's it.
Also, as you can see, my excel version uses " ; " instead of " , ".
I have over 50 modules of code and about 30 worksheets in each workbook. I also have about 15 workbooks, one for each branche of the company, but I need to create more workbooks for the new branches. The eample below is only a fraction of the whole list in the worksheet.
The content of Columns A and B is in a different worksheet and it is different for each branch. I use code to fill Column C (and the other 25+ columns, with different data. For example Column C shows the people working in the company regularly and Column D would normally show the temporary staff, and so on. As I said, the formulae are fixed and hardcoded by hand in each of the rows. My code only updates the cell that do not contain formulae.
I would be very grateful if you had any input on this problem and I'm looking forward to hearing your thoughts. Also, I'd be more than happy to answer any questions.
I have a database with names of employees working in various sections. Each Section has subsections who are run by managers and staff is working for them.
In the following example we have the following:
Column A shows the "position code", which is a code assigned to each "position". This code is handwritten, not automated. It is intended to show hierarchy of position.
Column B shows the "position" where each employee works.
Column C shows the count of staff that work in each "position". The actual staff is shown more clearly in column D, where you can see the numbers and the summing formulae.
For example rows 7, 8, 11, 12 all contain a summing formula or a subtotal formula.
In cell A3 I have the value "1", which is shown when I apply filters to the list. Because I use a lot of different filters in various columns (actually the whole list has more than 25 columns), I need the two different formulae in each summing row: ie to subtotal one and the sum one.
So far I have hardcoded each formula in each row. But I need to make this list more dynamic. I cannot use a pivot due to the various filters I need to apply and new data I show using vba.
Important thing to note is that I am using excel 2003 since I have not been able to upgrade my code as it presents many errors. The code also works well in excel 2007 but that's it.
Also, as you can see, my excel version uses " ; " instead of " , ".
I have over 50 modules of code and about 30 worksheets in each workbook. I also have about 15 workbooks, one for each branche of the company, but I need to create more workbooks for the new branches. The eample below is only a fraction of the whole list in the worksheet.
The content of Columns A and B is in a different worksheet and it is different for each branch. I use code to fill Column C (and the other 25+ columns, with different data. For example Column C shows the people working in the company regularly and Column D would normally show the temporary staff, and so on. As I said, the formulae are fixed and hardcoded by hand in each of the rows. My code only updates the cell that do not contain formulae.
I would be very grateful if you had any input on this problem and I'm looking forward to hearing your thoughts. Also, I'd be more than happy to answer any questions.
1 | A | B | C | D |
2 | ||||
3 | 1 | |||
4 | ||||
5 | ||||
6 | POSITION CODE | POSITION | NUMBER OF STAFF | FORMULA |
7 | 1 | SECTION 1 | 2 | =IF($A$3<>1;SUBTOTAL(9;D8:D10);(D8)) |
8 | 1.0 | MANAGER'S 1 OFFICE | 2 | =IF($A$3<>1;SUBTOTAL(9;D9:D10);SUM(D9:D10)) |
9 | 1.0.1 | MANAGER 1 | 1 | 1 |
10 | 1.0.2 | ASSISTANT MANAGER | 1 | 1 |
11 | 2 | SECTION 2 | 318 | =IF($A$3<>1;SUBTOTAL(9;D12:D113);(D12+D16+D18+D24+D30+D36+D59+D81+D86+D95+D102+D105+D109+D112)) |
12 | 2.0 | MANAGER'S 1 OFFICE | 3 | =IF($A$3<>1;SUBTOTAL(9;D13:D15);SUM(D13:D15)) |
13 | 2.0.1 | MANAGER 1 | 1 | 1 |
14 | 2.0.2 | ASSISTANT MANAGER 1 | 2 | 2 |
15 | 2.0.3 | ASSISTANT MANAGER 2 | 0 | 0 |
16 | 2.1 | MANAGER'S 2 OFFICE | 5 | =IF($A$3<>1;SUBTOTAL(9;D17);SUM(D17)) |
17 | 2.1.1 | MANAGER 2 | 5 | 5 |
18 | 2.2 | MANAGER'S 3 OFFICE | 40 | =IF($A$3<>1;SUBTOTAL(9;D19:D23);SUM(D19:D23)) |
19 | 2.2.1 | MANAGER 3 | 5 | 5 |
20 | 2.2.2 | ASSISTANT 1 | 10 | 10 |
21 | 2.2.3 | ASSISTANT 2 | 5 | 5 |
22 | 2.2.4 | ASSISTANT 3 | 10 | 10 |
23 | 2.2.5 | ASSISTANT 4 | 10 | 10 |