Forum menu
Exceltrackworld - h...
 

Exceltrackworld - help please

Posts: 2273
Full Member
Topic starter
Translate โ–ผ
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

As this forum seems to be the font of all knowledge, could one of the Excel gurus help me with a formula?

I have a list of around 2,000 members' postcodes of the format BS3 6AA, BS5 0WD etc.ย  I need to calculate the number of members in a single postcode upper area i.e. just BS3 or BS5.ย  I assume you use some form of COUNTIF formula, but I'm stuck on how to just count the postcode upper area.

Thanks in advance!

ย 


 
Posted : 05/06/2025 3:34 pm
Posts: 315
Full Member
Translate โ–ผ
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

New column with =left(find(" ",A1)-1) to get the first half of the post code?


 
Posted : 05/06/2025 3:44 pm
Posts: 14757
Full Member
Translate โ–ผ
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

You could use the LEFT function

https://www.w3schools.com/excel/excel_left.php

ย 

And then COUNTIF using the LEFT results as your wildcards - or just use a filter and count

https://exceljet.net/formulas/count-cells-that-begin-with


 
Posted : 05/06/2025 3:44 pm
Posts: 649
Free Member
Translate โ–ผ
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

LEFT function - Microsoft Support


 
Posted : 05/06/2025 3:45 pm
Posts: 315
Full Member
Translate โ–ผ
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Then copy the list of half postcodes, paste them as values in a new column, remove duplicates then use the countif against each one.


 
Posted : 05/06/2025 3:45 pm
 poly
Posts: 9128
Free Member
Translate โ–ผ
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

I think you can do =countif(A1:A2000,"*BS3*")


 
Posted : 05/06/2025 3:46 pm
Posts: 12888
Free Member
Translate โ–ผ
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

New column with =left(find(" ",A1)-1) to get the first half of the post code?

depends on postcode format (i.e. do they actually have the centre space or not?) If they don't you can use =LEFT(A1, LEN(A1) - 3) because (I think) they all end in 3 characters but the first bit can be 2-4 characters.

then another column to find the unique entries =UNIQUE(B1:B100)

and a final column to do the count =COUNTIF(B1:B100, C1)

Alternatively, especially if jobs like this are a one-off, just fling it all at ChatGPT and get it to figure it out. Not being an Excel guru personally, that's basically what I do these days - it's great at analysing and even altering data in XLS, PDF etc! 😃 Generally quicker than figuring out how to do it properly. (Or just get ChatGPT to tell you what formulas to use!)


 
Posted : 05/06/2025 3:48 pm
Posts: 3535
Full Member
Translate โ–ผ
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Screenshot below

A: has list of things to search

B: has this in B1, then dragged down to B20 to auto update the references =LEFT(A1, FIND(" ", A1)-1)

C1: has this which automatically pulls out the unique entries from B1:B20 =UNIQUE(B1:B20)

D: has this in D1, then dragged down to D4 to auto update the references =COUNTIF(B1:B20,C1)

image.png


 
Posted : 05/06/2025 4:12 pm
Posts: 1257
Free Member
Translate โ–ผ
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Use the Text to Columns function with space as the delimiter which will split the postcode into 2 columns, then create a pivot table on the column with the 1st column created to count the numbers by postcode area.


 
Posted : 05/06/2025 5:58 pm