ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count a value if next to another value... (https://www.excelbanter.com/excel-worksheet-functions/42359-count-value-if-next-another-value.html)

Pro_D Mike

Count a value if next to another value...
 
I'm entering data in a chart, and want to pull stats off that chart. Most
entries are text, but two columns contain types and codes. Lets say the set
of types is A,B,C, etc.., and the set of codes is 1,2,3, etc... I want to
count to get percentages of rows containing type A that are code 1 over all
rows containing type A; rows containing type A that are code 2 over all rows
containing type A, etc. for type B and C; also rows containing code 1 over
all rows, etc. for code 2, code 3; Little help?

Richard Neville

Without completely understanding your requirement, let me make this
suggestion: for Type A, set up a new column outside the print area. Let's
say that Type A is column D on the sheet and the new column is G. In the
first cell of G after the heading (G2), enter this formula: =IF(D2=1,1,0).
Drag the formula down the column. With the sum function, you can add all the
1s and 0s the formula will produce, and this will tell you the number of A's
that are coded 1. You can use the Count function to determine the number of
entries. Repeat the exercise for B and C, and for types 2 and 3. You can
then calculate the percentages.

"Pro_D Mike" <Pro_D wrote in message
...
I'm entering data in a chart, and want to pull stats off that chart. Most
entries are text, but two columns contain types and codes. Lets say the
set
of types is A,B,C, etc.., and the set of codes is 1,2,3, etc... I want to
count to get percentages of rows containing type A that are code 1 over
all
rows containing type A; rows containing type A that are code 2 over all
rows
containing type A, etc. for type B and C; also rows containing code 1 over
all rows, etc. for code 2, code 3; Little help?





All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com