+ Reply to Thread
Results 1 to 5 of 5

Postcode appears in two areas

  1. #1
    Registered User
    Join Date
    05-28-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    7

    Postcode appears in two areas

    Hi,

    I have a list of postcodes which appear in two areas within the UK.

    I need to be able to pivot this data so I only see the postcodes which appear in two areas. I also need to see which areas these are in.

    For example the postcode of CH 1 4EF appears in two areas and shows this on the pivot table but I am struggling to separate this out to only show the postcodes that appear in two areas.

    Thanks

    Paul
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Postcode appears in two areas

    For this, you'll either need to add helper column to source table or take advantage of Data Model based Pivot Table.

    My recommendation is to take advantage of Data Model based pivot table.

    1. Select your data range. Insert -> Pivot Table. Make sure to select "Add this data to the Data Model" in the dialog.

    2. Add Post Code to row label. Area into values field.

    3. Click on 'Count of Area'. Value field settings. Summarize value field by... select "Distinct Count".

    4. Filter row labels based on Value field = 2. Then add Area to row label.

    See attached.
    Attached Files Attached Files
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Postcode appears in two areas

    It's probably possible using Calculated Pivot Table Fields but I went outside the PT.
    First, I modified the format to Tabular and "Repeat all Item labels" (Design tab> Report Layout)
    Then in C4 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then apply a filter to that column and select "2"

    EDIT: I like CK's solution. I had never used the "Distinct Count" functionality.
    Attached Files Attached Files
    Last edited by ChemistB; 08-06-2020 at 12:25 PM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    05-28-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    7

    Re: Postcode appears in two areas

    Both work brilliantly but I went with the Distinct Count. Excellent work! Thanks

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Postcode appears in two areas

    You are welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Postcode check and return of value in column title and cell adjacent to postcode
    By BigTP in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-26-2018, 05:04 AM
  2. Postcode to postcode distance checker
    By KerryLL1221 in forum Excel General
    Replies: 1
    Last Post: 02-21-2014, 09:42 AM
  3. Lookup postcode zone from postcode
    By Elmholt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2013, 09:26 AM
  4. Replies: 5
    Last Post: 04-23-2013, 05:11 PM
  5. [SOLVED] Help needed trimming full postcode address to postcode sector.
    By Mikey7346 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 08-10-2012, 05:11 PM
  6. [SOLVED] Count rows between two areas in a collection/selection of multiple areas
    By JTwrk in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-02-2012, 10:38 AM
  7. Postcode Areas with issues
    By PFDave in forum Excel General
    Replies: 6
    Last Post: 07-11-2012, 05:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1