R
rrstudio2
I have a spreadsheet that in a simplified form looks like
Drug Pump
A 1
C 4
A 1
B 3
A 1
A 2
B 3
C 1
C 5
I need to determine how many different pumps each drug was on. So I
need to return
Drug #Pumps
A 2
B 1
C 3
The spreadsheets I am working with have about 30,000-50,000 rows, so
that may rule out array formulas. I would prefer to not use pivot
tables because the entire table is going into a pivot table for
analysis. If needed, I can resort the table but would prefer not to.
The best layout for my needs would be to have the # pumps column added
onto the original data table like
Drug Pump #pumps
A 1 2
C 4 3
A 1 2
B 3 1
A 1 2
A 2 2
B 3 1
C 1 3
C 5 3
Any thoughts on how I could do this with a formula? I can also use
visual basic because this spreadsheet has a macro that does some pre-
processing on it. It seems like this should be easy but I haven't run
into anyone who can do it yet.
Thanks,
Andrew V. Romero
Drug Pump
A 1
C 4
A 1
B 3
A 1
A 2
B 3
C 1
C 5
I need to determine how many different pumps each drug was on. So I
need to return
Drug #Pumps
A 2
B 1
C 3
The spreadsheets I am working with have about 30,000-50,000 rows, so
that may rule out array formulas. I would prefer to not use pivot
tables because the entire table is going into a pivot table for
analysis. If needed, I can resort the table but would prefer not to.
The best layout for my needs would be to have the # pumps column added
onto the original data table like
Drug Pump #pumps
A 1 2
C 4 3
A 1 2
B 3 1
A 1 2
A 2 2
B 3 1
C 1 3
C 5 3
Any thoughts on how I could do this with a formula? I can also use
visual basic because this spreadsheet has a macro that does some pre-
processing on it. It seems like this should be easy but I haven't run
into anyone who can do it yet.
Thanks,
Andrew V. Romero