Excel Formula

Tvynn

New Member
Joined
Oct 18, 2018
Messages
10

Hi, refer to attachment, I'd like to find out how many time the email at column A appears at col. B (within the same row only. Eg. A1 with B1, A2 with B2). Currently I have this formula as appeared at col. C1, but it's not that accurate, as long as the emails at col. B are longer that email at col. A, it will count it. Wonder if you knows the accurate formula to count it? Much appreciated! Many thanks for your help!


<colgroup><col></colgroup><tbody>
</tbody>

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
EmailRangeFormula
=(LEN(C2)-LEN(SUBSTITUTE(UPPER(C2),UPPER(A2),"")))/LEN(A2)
Accurate Result
A@abc.comA@abc.com.sg/connection lost, A@abc.com.sg/connection lost, AA@abc.com.sg/unknown, A@abc.com/error4wrong, should be 1
bb@mail.com.sgbb@gmail.com.sg/connection lost, aa@mail.com.sg/connection lost, bb@mail.com/error0correct
ab@outlook.comaab@outlook.com/connection lost, aab@outlook.com.my/connection lost, ab@outlook.my/connection lost2wrong, should be 0

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Welcome to Mr Excel forum

Maybe...
=(LEN(","&SUBSTITUTE(C2," ",""))-LEN(SUBSTITUTE(UPPER(","&SUBSTITUTE(C2," ","")),UPPER(","&A2&"/"),"")))/LEN(","&A2&"/")

Hope this helps

M.
 
Upvote 0
I am going to offer a different approach using the Search function. The search function matches whether the string to be searched for is upper or lower case, (The Find function requires matching case.)

Bear in mind, this is not exactly what you asked for as it returns a 0 if the email address is not found or a 1 if it is found. Although if there is a small number of error types, you could add additional formulas which include the error type in the search string, e.g., "/connection lost", etc.

Also, I had to add the space, (" "&) so that aab@outlook.com would not be counted even though it contains ab@outlook.com

=IF(ISERROR(SEARCH(" "&$A4&"/"," "&$B4)),0,1)

I hope this helps.

Paul
 
Upvote 0
I took one more shot at this and now have the formula counting the occurrences of the email address within the string, so if the email is listed more than once, e.g., with more than one error, it should count it as many times.

At least it worked for me when I dummied a record with an email address listed twice.

=(LEN(" "&$C4&"/")-LEN(SUBSTITUTE(UPPER(" "&$C4&"/"),UPPER(" "&$A4&"/"),"")))/(LEN($A4)+2)
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,414
Members
448,895
Latest member
omarahmed1

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