Drug database

ArsenalFan1

New Member
Joined
Sep 18, 2006
Messages
8
Hi,

I have data in the following format

Drug Name---------Source-----Amount---Count
Actonel 30Mg-------Single------10---------2
Actonel 20Mg-------Brand------20---------3
Paxil 230------------Single------30---------3
Paxil CF 40--------- Single------10---------1
Rapamune Oral----Generic-----20---------2
Rapumune Tab-----Generic----20----------1
Singulair 10Mg-----Single-------5-----------4
Zoloft 20------------Single-------10---------6
Zoloft 40------------Single-------40---------8

Now this is a short sample. There may be 150 drugs. I dont know the names. I am trying to do the following: Add the amount for the same drug and the count and get the percentage of the total amount. For e.g.

Drug Name---------Source-----Amount---Count---Drg Amt--Drg Cnt--%
Actonel 30Mg-------Single------10---------2--------------------------------
Actonel 20Mg-------Brand------20---------3--------30-----------5-----30/165
Paxil 230------------Single------30---------3--------------------------------
Paxil CF 40--------- Single------10---------1-------40----------4------40/165
Rapamune Oral----Generic-----20---------2------------------------------
Rapumune Tab-----Generic----20----------1------40----------3------40/165
Singulair 10Mg-----Single-------5-----------4------5-----------4------5/165
Zoloft 20------------Single-------10---------6--------------------------------
Zoloft 40------------Single-------40---------8------50----------14-----50/165
TOTAL----------------------------165--------------------------------------------

All the drugs are in alphatic order. I have tried the following but its so time consuming and i have to do this for atleast 100 different sheets. I think coming up with a solution might save more time and my fingers.

I am doing the following but its not fullproof. Adding another column and doing LEFT(DRUG NAME,7) but i run into problems if two drugs have similar first 7 chars. If i used 10 then same drugs become different e.g. Paxil 3 and Paxil 4. After that i did SumIF with shorter drug name and manually removed the dulicates.

Is there an easier way? For e.g. make the drug names shorter by using the first white space it finds? Since its in alphabetic order, add same drug names until it comes to a different name?

Any help or ideas are appreciated.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I would use Andrew's formula to get a "Category" column with just the first name of each drug, then crate a Pivot Table to get your counts, sums, and % of total.
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,614
Members
449,039
Latest member
Mbone Mathonsi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top