![]() |
Multiple subtotals on a single line
I have a large file that has all of the drugs that our patients have taken
for a period of time. I need to get a subtotal by the drug number (average cost) and the number of clients that have received the drugs by drug number. Is there a way to get both the subtotals on a single line. I need to transfer the data from this worksheet to another sheet provided by contractor. The file looks similar to this. NDC# (drug ID) Client# Unit Cost Date (asst' other columns) |
Multiple subtotals on a single line
You want to treat the drugid and client# as one field (essentially)?
How about using a helper column: =a2&"!"&b2 and drag down. Then subtotal using that column. Then you could hide the details select the range to copy edit|goto|special|check visible copy and paste. Then insert another column to the right of that combined field. select that column and do data|text to columns|delimited by the !. You may want to learn a bit about data|Pivottable. It may do what you want a little easier (after investing a little learning time). Steve D wrote: I have a large file that has all of the drugs that our patients have taken for a period of time. I need to get a subtotal by the drug number (average cost) and the number of clients that have received the drugs by drug number. Is there a way to get both the subtotals on a single line. I need to transfer the data from this worksheet to another sheet provided by contractor. The file looks similar to this. NDC# (drug ID) Client# Unit Cost Date (asst' other columns) -- Dave Peterson |
Multiple subtotals on a single line
Dave:
The problem I have here is that I need a total of the average cost of the drug and the number of clients that took the drug. I can get both of these totals, but not on a single sub-total line. I can alway drag subtotal into other columns but there are nearly 200 drugs 700 clients and over 8000 records. "Dave Peterson" wrote: You want to treat the drugid and client# as one field (essentially)? How about using a helper column: =a2&"!"&b2 and drag down. Then subtotal using that column. Then you could hide the details select the range to copy edit|goto|special|check visible copy and paste. Then insert another column to the right of that combined field. select that column and do data|text to columns|delimited by the !. You may want to learn a bit about data|Pivottable. It may do what you want a little easier (after investing a little learning time). Steve D wrote: I have a large file that has all of the drugs that our patients have taken for a period of time. I need to get a subtotal by the drug number (average cost) and the number of clients that have received the drugs by drug number. Is there a way to get both the subtotals on a single line. I need to transfer the data from this worksheet to another sheet provided by contractor. The file looks similar to this. NDC# (drug ID) Client# Unit Cost Date (asst' other columns) -- Dave Peterson |
Multiple subtotals on a single line
So you're subtotalling by DrugId?
If yes, then just use Average for each field. But then select the column with the client name edit|replace what: =subtotal(1, with: =subtotal(3, replace all =subtotal(1,xxx) will do the average =subtotal(3,xxx) will do the count (counta, actually). Is that what you meant? Steve D wrote: Dave: The problem I have here is that I need a total of the average cost of the drug and the number of clients that took the drug. I can get both of these totals, but not on a single sub-total line. I can alway drag subtotal into other columns but there are nearly 200 drugs 700 clients and over 8000 records. "Dave Peterson" wrote: You want to treat the drugid and client# as one field (essentially)? How about using a helper column: =a2&"!"&b2 and drag down. Then subtotal using that column. Then you could hide the details select the range to copy edit|goto|special|check visible copy and paste. Then insert another column to the right of that combined field. select that column and do data|text to columns|delimited by the !. You may want to learn a bit about data|Pivottable. It may do what you want a little easier (after investing a little learning time). Steve D wrote: I have a large file that has all of the drugs that our patients have taken for a period of time. I need to get a subtotal by the drug number (average cost) and the number of clients that have received the drugs by drug number. Is there a way to get both the subtotals on a single line. I need to transfer the data from this worksheet to another sheet provided by contractor. The file looks similar to this. NDC# (drug ID) Client# Unit Cost Date (asst' other columns) -- Dave Peterson -- Dave Peterson |
All times are GMT +1. The time now is 07:08 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com