+ Reply to Thread
Results 1 to 11 of 11

Match full postcode against list of partial postcodes

  1. #1
    Forum Contributor
    Join Date
    05-26-2004
    Location
    Halifax, UK
    MS-Off Ver
    Office 2016
    Posts
    260

    Match full postcode against list of partial postcodes

    I have a list of partial postcodes where we are carrying out monitoring of some field work. There are about 30 areas where this is happening but the scale is different, e.g. in some areas we are doing work in the postcode region LS3, so this includes ALL postcodes starting LS3 (e.g. LS3 4NT, LS3 2RJ etc). In some areas the work is more focused, e.g. it is in HD9 3, so would include HD9 3BX, HD9 3EF etc, but not HD9 4TS and so on

    My problem is this: every week I get a list of ALL the jobs we've carried out and for each job the identifying location is the full postcode and for each of these I need to find the ones which are in the list of sites we are monitoring (we do jobs in far more areas than we are monitoring but I need to search what is common in both lists). However the issue is that the search terms aren't consistent in size or type, i.e. if the full postcode is HD3 9BX, I might for instance want to match it to HD3 areas, or I might want to be more specific and only match it to HD3 9 areas.

    To give some examples, suppose this is the list of areas I am monitoring - these are the partial post codes I'm interested in:
    BD3
    BD4
    LS12 4

    I get a list of completed jobs, the postcodes of which are:
    LS13 4BX
    BD3 9RU
    BD3 7KB
    LS12 4BX
    LS12 3ZT

    I need a formula which takes each postcode from the completed list of jobs and determines which, if any, of the partial postcodes from the monitoring sites applies to it. So in the data above, LS13 4BX doesn't appear in the monitoring sites so would return nothing. BD3 appears twice (BD3 9RU and BD3 7KB) and LS12 4 appears once (LS12 4BX but not LS12 3ZT).

    I'm trying to put a formula together that will pick out the correct partial postcode and match it to the full postcode. Ideally the value returned should be the correct partial postcode against the full postcode, e.g.
    BD3 9RU = BD3
    LS12 4BX = LS12 4
    and so on...

    Thanks in advance!

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Match full postcode against list of partial postcodes

    Could you put together a workbook and show your expected outcome (manually generated)?

    BSB

  3. #3
    Forum Contributor
    Join Date
    05-26-2004
    Location
    Halifax, UK
    MS-Off Ver
    Office 2016
    Posts
    260

    Re: Match full postcode against list of partial postcodes

    See attached, thx!
    Attached Files Attached Files

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Match full postcode against list of partial postcodes

    Try this in M4:

    =IFERROR(INDEX(A:A,SMALL(IF(ISNUMBER(FIND(A$4:A$30,G4)),ROW(A$4:A$30)),1)),"no match") Ctrl Shift Enter

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Match full postcode against list of partial postcodes

    or can try below formula
    =IFERROR(INDEX($A:$A,LOOKUP(2,1/COUNTIF($L4,$A$4:$A$30&"*"),ROW($A$4:$A$30))),"no match")
    or
    =IFERROR(INDEX($A:$A,LOOKUP(2,1/MATCH($A$4:$A$30&"*",L4,0),ROW($A$4:$A$30))),"no match")
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Registered User
    Join Date
    05-04-2018
    Location
    S
    MS-Off Ver
    2016
    Posts
    2

    Re: Match full postcode against list of partial postcodes

    Victor Masingita Makhubele
    50 mins
    Afternoon, Experts

    1. I would like to have a formula or code which will provide a sum of manhour without DI, meaning if each month manhour has a DI from 1 (as highlighted in red) the month's manhour must be exluded. The document must automatically get its total man hour without DI light higlighted in yellow.

    2. The document must be rolling kind as monthly information is captured and runs for 12 months period. And if you add the current month the first month on the block must be moved out.

    Thanks for your help. I am willing to pay if

  7. #7
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Match full postcode against list of partial postcodes

    Good afternoon victorkhube

    Unfortunately your post does not comply with Rule 4 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Please familiarise yourself with the rules before posting. You can find them here.

  8. #8
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Match full postcode against list of partial postcodes

    Hi,

    This would also work, in M4 copied down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached.
    Attached Files Attached Files

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Match full postcode against list of partial postcodes

    Another way
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  10. #10
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Match full postcode against list of partial postcodes

    May be much shorter can be

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  11. #11
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Match full postcode against list of partial postcodes

    Quote Originally Posted by jtakw View Post
    Hi,

    This would also work, in M4 copied down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached.
    Quote Originally Posted by shukla.ankur281190 View Post
    May be much shorter can be

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Don't know about "much shorter", basically the same formula...

+ 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. Index matching on postcodes - but only a certain part of a postcode
    By blackrosepetals9169 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-20-2018, 09:40 AM
  2. Replies: 0
    Last Post: 02-10-2016, 09:37 PM
  3. Replies: 8
    Last Post: 03-29-2014, 10:05 AM
  4. [SOLVED] Postcode Sectors from Full Postcodes
    By jasonjholt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-13-2013, 05:19 AM
  5. Match formula Full match vs. Partial
    By StevenH61 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-26-2013, 10:29 AM
  6. Formula needed to return values for partial or full match
    By IntRes in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-07-2012, 08:32 AM
  7. [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

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