This is a shorted version of a spreadsheet. I would like to compare to sets of data to find the occurrences of certain post codes. Here is the data Column Columbia CV1 2AA CV1 2AA CV1 2AB CV1 2AB CV1 2AD CV1 2AD CV1 2AE CV1 2AE CV1 2AF CV1 2AF CV1 2AG CV1 2AG CV1 2AH CV1 2AH CV1 2AJ CV1 2AJ CV1 2AL CV1 2AL CV1 2AN CV1 2AN CV1 2AP CV1 2AP CV1 2AQ CV1 2AQ CV1 2AR CV6 2DR
I need a way to compare the two and count the occrances in Column B that occure in Column A. These are UK Zip codes / post codes
Any help would be appreciated. Answer from Richard Rost:
This is a good example of when to use the COUNTIF function. In your case, you could say something like this in cell C3:
=COUNTIF(A:A,B1)
Now you'll see how many times the value in B1 appears in column A. Autofill this down the column, and you're all set.
Here's more on COUNTIF:
You can use the SUMIF and COUNTIF functions to add up or count values based on specific criteria, respectively.
Here is a free tutorial that explains how to use both:
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Excel Forum.