Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Steve D
 
Posts: n/a
Default 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)
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.misc
Steve D
 
Posts: n/a
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
in a line of three possible answers how to prevent multiple answer RichardZ Excel Worksheet Functions 1 September 7th 05 01:46 PM
Charts Line Types for Multiple Data Series not Printing Properly Seanb Charts and Charting in Excel 0 August 22nd 05 06:35 PM
Macro for single to multiple cols. Help! dfkelly42 New Users to Excel 5 July 1st 05 09:07 PM
Multiple columns of data saved in a CSV file appears in a single c TRR Excel Discussion (Misc queries) 2 June 8th 05 01:49 PM
Toggle multiple values in single cell Chandni Excel Worksheet Functions 5 February 10th 05 12:48 AM


All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"