How can I use Count and Sum function in one cell from table below?

Dolan, Whitney@DSH-C 20 Reputation points
2023-08-25T17:32:32.1766667+00:00

I am looking to count and sum the cells in the example below. I want the result to reflect the total number of groups as well as total number of those participated in the groups. For example, the result should be 3 (20). This reflects there were 3 groups held, with a total of 20 participants among the groups. How can I create a formula that counts the "1"s and Sums the # in parentheses?

Intervention
1 (9)
1 (4)
1 (7)
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,176 questions
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 121.3K Reputation points
    2023-08-25T19:35:25.86+00:00

    Check a formula:

    =COUNTIF(A1:A3,"1 (*") & " (" & SUM(--TEXTBEFORE(TEXTAFTER(A1:A3,"(",,,,""),")",,,,0)) & ")"
    

    Use the required range instead of A1:A3.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.