Sum of All Numbers Inside the Parenthesis

enzocontreras

New Member
Joined
Aug 5, 2018
Messages
2
Hello Guys!
I'm currently working on a worksheet and i need help on the formula. Im trying to get the guest count from the long list given to me in an excel sheet where name of guest and head count is written together in 1 cell and in a single column.

1) I would like to get the sum of all the numbers inside the parenthesis..
Example:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">RIZA SMITH (2A/1C) = 3
LANIE ADAMS (2A) = 2
STEVE ANDREWS (1A/3C) = 4

TOTAL GUEST COUNT : = 9</code>2) or just autosum all the numbers inside the parenthesis in a column

Hope you guys can help me.. Thanks in advance! =)
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
with your example (I assume that numbers are only between brackets, if not it will sum all numbers in the string)


RIZA SMITH (2A/1C)
3​
=SUMPRODUCT(--(0&MID(A1,ROW($1:$100),TEXT(FREQUENCY(-ROW($1:$99),-ISERR(-MID(0&A1,ROW($1:$99),1))*ROW($1:$99))-1,"[<]\0"))))
LANIE ADAMS (2A)
2​
STEVE ANDREWS (1A/3C)
4​
 
Last edited:
Upvote 0
or a little longer vwersion:
Code:
=SUMPRODUCT(--(0&MID(MID(A1,SEARCH("(",A1),SEARCH(")",A1)-SEARCH("",A1)),ROW($1:$100),TEXT(FREQUENCY(-ROW($1:$99),-ISERR(-MID(0&MID(A1,SEARCH("(",A1),SEARCH(")",A1)-SEARCH("",A1)),ROW($1:$99),1))*ROW($1:$99))-1,"[<]\0"))))
limited to ( )
 
Upvote 0
with your example (I assume that numbers are only between brackets, if not it will sum all numbers in the string)


RIZA SMITH (2A/1C)
3​
=SUMPRODUCT(--(0&MID(A1,ROW($1:$100),TEXT(FREQUENCY(-ROW($1:$99),-ISERR(-MID(0&A1,ROW($1:$99),1))*ROW($1:$99))-1,"[<]\0"))))
LANIE ADAMS (2A)
2​
STEVE ANDREWS (1A/3C)
4​

<tbody>
</tbody>


Thank you very much! the formula works!
 
Upvote 0
You are welcome
look at the comment for the first formula, and if there will be any number outside the brackets - use second.

Have a nice day
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,093
Latest member
catterz66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top