Function to return a specific number of message recipients

mleifer001

New Member
Joined
Sep 10, 2009
Messages
10
I have a a bunch of emails (over 52,000) exported into Excel and I need a function to return emails with less than 5 recipients (including the To, CC, and BCC fields). Also, the email addresses vary based on internal/external addresses so the only way (that I know) to figure out how many recipients there are is to count the commas separating the email addresses. Each email has a corresponding control number, so...

I need a function that would return the control number of emails with less than 5 commas in the To, CC, and BCC fields combined.

Help!!

Thank you :)
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
It's not clear how the To, Cc & Bcc data is stored - are these recipient strings stored in separate columns or in one elongated string ?

If we assume you need to calculate based on comma as implied you can subtract the length of the address string without the commas from the same string with commas - the difference (+1 if not blank) is your count of recipients.

Basic example of the above below:


Excel Workbook
ABCD
1ToCcBccCount
2Jim Dxyz@somewhere.com,ajskaj@abc.co.uk3
3Jim D, zyz@hjds.netds@dsjk.com,Dave H,Terry T5
Sheet5


If you wanted to return the count of mails with < 5 recipients in a single cell calculation and without use of helpers then one approach (extension of above) would be:

Code:
=SUMPRODUCT(((($A$2:$A$3<>"")+($B$2:$B$3<>"")+($C$2:$C$3<>""))+(LEN($A$2:$A$3&$B$2:$B$3&$C$2:$C$3)-LEN(SUBSTITUTE($A$2:$A$3&$B$2:$B$3&$C$2:$C$3,",","")))<5)+0)
 
Upvote 0
Yes, separate To, CC, and BCC fields just as you constructed. I will give this a try but it seems like it will work very well for what I need.

Thank you!!!!

:laugh::laugh::laugh:
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,856
Members
452,948
Latest member
UsmanAli786

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