I’ve searched the web but I can’t find anything specific for this.
I have column A as below, I need to search this column and find out how many occurrences there are of the data in column B, in the example below there a 4 (70011×3 + 70014×1).
A B
h323:70011 70011
70007 70012
70011 70013
h323:70014 70014
sip:70011@domain.com 70015
What formula would I need to use in Excel?
Thanks in advance
… I don’t know if there’s a simple way to do this with a single worksheet function, but I could think of 2 methods I would use to accomplish this (and would love to see if any person could figure out how to do this in a single, simple, worksheet function I couldn’t think of).
Either way, my solutions would be:
1) Use Array Formulas:
This would look as follows:
Note that for this solution, you have to type it in as an array formula (Hit ctrl+shift+enter) at the end, but when you drag down column C and sum it up, you will get the correct total.
The challenge with this one is that it doesn’t really give you the answer in one cell.
2) Use a Custom VBA Function (My Preferred method):
You can write your own VBA function to do this VERY EASILY.
The one I created was:
All you can then do is in any cell type in
=myfunc(B1:B5,A1:A5)and you will get the right answer.Hope this helps!