Hello,
I'm trying to create a formula that will count the number of occurrences for a specific value.
For example, column A and column B are my inputs in the table below. Column C is my output.
In column C, I would need the formula to count how many times a city is listed under their respective state.
California for instance has 3 cities listed and they are San Diego, Los Angeles and Irvine. Therefore, the value 3 would be listed in column C for California.
A city may be listed more than once, so duplicates would need to be excluded. For example, San Diego is listed twice in column A, but it would only count as one.
Thank you for your time!
Mark9988
<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">2</td><td style="font-weight: bold;text-align: center;background-color: #B8CCE4;;">State</td><td style="font-weight: bold;text-align: center;background-color: #B8CCE4;;">City</td><td style="font-weight: bold;text-align: center;background-color: #B8CCE4;;">Cities found in State</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">CA</td><td style=";">San Diego</td><td style="text-align: center;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">CA</td><td style=";">San Diego</td><td style="text-align: center;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style=";">CT</td><td style=";">Hartford</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style=";">CT</td><td style=";">Hartford</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style=";">FL</td><td style=";">Miami</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style=";">CA</td><td style=";">Los Angeles</td><td style="text-align: center;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style=";">CA</td><td style=";">Irvine</td><td style="text-align: center;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style=";">TX</td><td style=";">Dallas</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style=";">TX</td><td style=";">Austin</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style=";">CT</td><td style=";">New Haven</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style=";">WA</td><td style=";">Seattle</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">14</td><td style=";">AZ</td><td style=";">Phoenix</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">15</td><td style=";">AZ</td><td style=";">Phoenix</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">16</td><td style=";">NC</td><td style=";">Charlotte</td><td style="text-align: center;;">1</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet2</p><br /><br />
I'm trying to create a formula that will count the number of occurrences for a specific value.
For example, column A and column B are my inputs in the table below. Column C is my output.
In column C, I would need the formula to count how many times a city is listed under their respective state.
California for instance has 3 cities listed and they are San Diego, Los Angeles and Irvine. Therefore, the value 3 would be listed in column C for California.
A city may be listed more than once, so duplicates would need to be excluded. For example, San Diego is listed twice in column A, but it would only count as one.
Thank you for your time!
Mark9988
<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">2</td><td style="font-weight: bold;text-align: center;background-color: #B8CCE4;;">State</td><td style="font-weight: bold;text-align: center;background-color: #B8CCE4;;">City</td><td style="font-weight: bold;text-align: center;background-color: #B8CCE4;;">Cities found in State</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">CA</td><td style=";">San Diego</td><td style="text-align: center;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">CA</td><td style=";">San Diego</td><td style="text-align: center;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style=";">CT</td><td style=";">Hartford</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style=";">CT</td><td style=";">Hartford</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style=";">FL</td><td style=";">Miami</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style=";">CA</td><td style=";">Los Angeles</td><td style="text-align: center;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style=";">CA</td><td style=";">Irvine</td><td style="text-align: center;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style=";">TX</td><td style=";">Dallas</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style=";">TX</td><td style=";">Austin</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style=";">CT</td><td style=";">New Haven</td><td style="text-align: center;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style=";">WA</td><td style=";">Seattle</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">14</td><td style=";">AZ</td><td style=";">Phoenix</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">15</td><td style=";">AZ</td><td style=";">Phoenix</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">16</td><td style=";">NC</td><td style=";">Charlotte</td><td style="text-align: center;;">1</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet2</p><br /><br />