Attached is a sample file with 3 worksheets. The worksheet, Strings of Interest, has a list of strings that I need to get counts of from the data in the worksheet, Raw Data. I'd like to have a third worksheet like what I'm showing in this file as the sheet, Summary Data. The Summary Data sheet shows the number of occurrences of each String of Interest in the Raw Data sheet.
I know how to create a helper column to count for each unique value, and to then sum all the occurrences, but that feels inefficient. My Raw Data sheet could have anywhere from 500 records, to 40,000 records. My "Strings of Interest" could change somewhat frequently over time. I have lots of files in which I need to do this same thing.
What is a better/more efficient way to do what I'm trying to do?
Last edited by SueWithQuestion; 08-22-2011 at 09:48 AM.
If you remove the = signs from the column A entries, then in B2 enter:
=COUNTIF('Raw Data'!A:A,"*"&A2&"*")
copied down to easily get count of each item
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Using your sample workbook...on the Summary Data sheet
This regular function begins the list of "Strings of Interest"
and this regular formula returns the count of the Col_A string from the Raw Data sheetA2: =IF(COUNTA('Strings of Interest'!$A:$A)>=ROWS('Summary Data'!$2:2), INDEX('Strings of Interest'!$A:$A,ROWS('Summary Data'!$2:2)),"")
Copy those formulas down as far as you need.B2: =IF(A2<>"",COUNTIF('Raw Data'!$A:$A,"*"&A2),"")
Is that something you can work with?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks