Help with counting postcode types

NJ34A

New Member
Joined
Nov 10, 2022
Messages
7
Office Version
  1. 2021
Platform
  1. Windows
Hi, I'm very basic in my knowledge of excel but can really do with some help.
I simple want to be able to count partial post codes but the problem, I'm finding is the formula is either counting post codes it shouldn't not working at all.
I want to count all post codes starting with B without also counting postcodes in BA or BB etc and likewise for other post codes
Please make it as easy as possible - Thanking you kindly
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
You say you don't want to count BB but you show in your sample a value. Confused. Do you want to count all Post Codes starting with B? Can you explain in full detail your requirements as what you have said is not entirely clear.
 
Upvote 0
I want to count all post codes starting with B without also counting postcodes in BA or BB

Do you mean something like this?
Book1
ABCD
1Post CodeLocCount post codes starting with B w/o BA or BB
2ABAberdeen4
3ALSt Albans
4BBirmingham
5BABath
6BBBlackburn
7BDBradford
8BHBournemouth
9BLBolton
Sheet1
Cell Formulas
RangeFormula
D2D2=COUNTIFS(A2:A9,"=B*")-COUNTIF(A2:A9,"BA")-COUNTIF(A2:A9,"BB")
 
Upvote 0
Solution
Hi

Thanks for your response, yes that is correct
 
Upvote 0
Hi

Thanks for your solution, will work on that now

Kind Regards
 
Upvote 0
Do you mean something like this?
Book1
ABCD
1Post CodeLocCount post codes starting with B w/o BA or BB
2ABAberdeen4
3ALSt Albans
4BBirmingham
5BABath
6BBBlackburn
7BDBradford
8BHBournemouth
9BLBolton
Sheet1
Cell Formulas
RangeFormula
D2D2=COUNTIFS(A2:A9,"=B*")-COUNTIF(A2:A9,"BA")-COUNTIF(A2:A9,"BB")
Hi

It's still counting the wrong fields maybe I have done something wrong.
Here is what I have done.
Working with the below post codes on the left.
Here is my formula based on what you have supplied

=COUNTIFS(AV21:AV515,"=B*")-COUNTIF(AV21:AV515,"BA")-COUNTIF(AV21:AV515,"BB")-COUNTIF(AV21:AV515,"BD")-COUNTIF(AV21:AV515,"BH")-COUNTIF(AV21:AV515,"BL")-COUNTIF(AV21:AV515,"BN")-COUNTIF(AV21:AV515,"BR")-COUNTIF(AV21:AV515,"BS")-COUNTIF(AV21:AV515,"BT")



These are the post codes I put in to test, but for B (Birmingham) the count after executing the formula is 4
SW12 1TY
SK 2
SK1 E45
AL L90
AB Y78
B1 24
BA 54
AB34 B67
BB1
B1 232
 
Upvote 0
I think you should consider posting some actual data to indicate what you want to count vs. what you want to exclude. Example:
Book1
ABC
1Example DataStarting with "B" Items to includeStarting with "B" Items to exclude
2SW12 1TY
3SK 2
4SK1 E45
5AL L90
6AB Y78
7B1 24x
8BA 54x
9AB34 B67
10BB1x
11B1 232x
12SW12 1TY
13SK 2
14SK1 E45
15AL L90
16AB Y78
17B1 24x
18BA 54x
19AB34 B67
20BB1x
21B1 232x
Sheet2


Condsider using the free XL2BB tool (link below) to post your data in a way that makes it accessible to others.

 
Upvote 0
Hi Again,

do not have no data, downloaded the file but it wont open in protected view.
 
Upvote 0
I think you should consider posting some actual data to indicate what you want to count vs. what you want to exclude. Example:
Book1
ABC
1Example DataStarting with "B" Items to includeStarting with "B" Items to exclude
2SW12 1TY
3SK 2
4SK1 E45
5AL L90
6AB Y78
7B1 24x
8BA 54x
9AB34 B67
10BB1x
11B1 232x
12SW12 1TY
13SK 2
14SK1 E45
15AL L90
16AB Y78
17B1 24x
18BA 54x
19AB34 B67
20BB1x
21B1 232x
Sheet2


Condsider using the free XL2BB tool (link below) to post your data in a way that makes it accessible to others.


This is exactly what I'm trying to achieve
 
Upvote 0

Forum statistics

Threads
1,215,377
Messages
6,124,597
Members
449,174
Latest member
chandan4057

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