# Thread: excel formulas using subtotals

1. I have a macro that I want to enhance with formula subtotals. My present macro has subtotals in several columns which are derived using the basic excel data>subtotal function. I now need to use these subtotals to create additional subtotals in 2 subsequent columns ie: p=sum(o/m) and q=sum(o/k). I presently add these formulas in manually each day because the data changes daily and therefore subtotals are not always on the same row but will always be in the same column. Anyone know how to do this?

Thanks

2. I'm sorry, I don't see any formulas in the workbook that you attached and I don't understand what you want to accomplish.

3. [quote name='HansV' post='773694' date='04-May-2009 19:58']I'm sorry, I don't see any formulas in the workbook that you attached and I don't understand what you want to accomplish.[/quote]

Let me try again....I have totals in several columns [columns A, C, and E) these were derived using data subtotals. I now need to add in formulas to columns F and G. Column F formula is =sum(order contribution/net order value) and column G formula is =sum(order contribution/order kgs) these 2 values need to fall on the same rows as the other subtotals, those subtotals that I am using in the formulas. Each day the data changes so today subtotals may be on row 10 and 12 but tomorrow the subtotals may be on rows 15 and 24 and so forth. I want to automate these additional formulas with a macro.

Thanks

4. ........ I now need to add in formulas to columns F and G. Column F formula is =sum(order contribution/net order value) and column G formula is =sum(order contribution/order kgs) .............
1] F2 :

=ROUND(SUM(E2:INDEX(E:E,MATCH(9.9E+307,E:E)))/SUM(C2:INDEX(C:C,MATCH(9.9E+307,C:C))),2)

2] G2 :

=ROUND(SUM(E2:INDEX(E:E,MATCH(9.9E+307,E:E)))/SUM(A2:INDEX(A:A,MATCH(9.9E+307,A:A))),2)

Regards
Bosco

#### Posting Permissions

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