Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sum or Count?
I have a single column that contains multiple entries of 7 different ratings: P, PG, PG13, R, NC17, X, Unrated. I'm trying to initialize a Summary userform with the sum of each of these and assign these sums to a label for each of the ratings. I thought about Sum or Count but I can't figure out the best way to extract all the entries for each rating, get a total and assign it to a variable. Any ideas? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sum or Count?
If you want to use a formula: ="P = " & COUNTIF(A3:A15, "P") I used rang A3:A15, but you can use whatever range the criteria is in. CountIf concatenated to each rating, i.e. "PG = ", PG13 = ", etc. will give you an output like P = 5, PG = 11, etc. You need a formula for each rating code in their individual cells. "Bishop" wrote in message ... I have a single column that contains multiple entries of 7 different ratings: P, PG, PG13, R, NC17, X, Unrated. I'm trying to initialize a Summary userform with the sum of each of these and assign these sums to a label for each of the ratings. I thought about Sum or Count but I can't figure out the best way to extract all the entries for each rating, get a total and assign it to a variable. Any ideas? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sum or Count?
A Pivot table does this in no time. But you need it in code onto a userform?
If your entries are strictly limited and at all times properly spelled <g, this might be a start: Sub test() MsgBox Application.WorksheetFunction.CountIf(Sheets(1).Ra nge("A1:A1000"), "PG13") End Sub COUNTIF is the proper spreadsheet formula here if I understand you correct. HTH. Best wishes Harald "Bishop" wrote in message ... I have a single column that contains multiple entries of 7 different ratings: P, PG, PG13, R, NC17, X, Unrated. I'm trying to initialize a Summary userform with the sum of each of these and assign these sums to a label for each of the ratings. I thought about Sum or Count but I can't figure out the best way to extract all the entries for each rating, get a total and assign it to a variable. Any ideas? ----------------------------------------------------------------------------- Our Peering Groups change Visit : http://spacesst.com/peerin |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sum or Count?
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count Employee Work Time - Don't Count Duplicates | Excel Worksheet Functions | |||
Count Employee Work Time - Don't Double-count Overlapping Apts. | Excel Worksheet Functions | |||
Excel 2000, count, sort a list & count totals? | Excel Worksheet Functions | |||
Excel Count characters in a textbox to display character count? | Excel Programming | |||
Count Intervals of Filtered TEXT values in Column and Return Count across a Row | Excel Worksheet Functions |