+ Reply to Thread
Results 1 to 5 of 5

Assign area to postcode from multiple arrays function

  1. #1
    Registered User
    Join Date
    09-30-2014
    Location
    Manchester, England
    MS-Off Ver
    2013
    Posts
    5

    Cool Assign area to postcode from multiple arrays function

    Hello,

    I'm hoping you can help. I have a list of the first 4 letters of a postcode, and based on a separate list of postcodes, I'd like to return a value of what sector they're from. Here is an example:

    Sheet One

    1 BB1 1 FORMULA TO WORK OUT SECTOR
    2 BB5 2 FORMULA TO WORK OUT SECTOR
    3 BL1 2 FORMULA TO WORK OUT SECTOR
    4 BL2 2 FORMULA TO WORK OUT SECTOR

    Sheet Two

    1 Bolton Wigan Salford
    2 BL1 1 BB1 1 M6 6
    3 BL2 2 BB5 2 M6 1
    4 BL3 1
    5 BL3 6

    Obviously, the real data is more complete than that, but hopefully you get the idea. In 'normal english,' I imagine the formula needs to work something like:
    IF A1 matches any of the array in sheet 2, A1 - A5, Then return "Bolton, but if it doesn't, try range in Sheet 2, B1-B5 and if it matches, return Wigan. If it doesn't match that, try the next column etc etc, and if it doesn't match any of the columns, then simply return 'No Sector.

    I feel this might be asking too much of excel, especially as the formula will be on each row in the main sheet.

    Am I asking too much?

    Looking forward to your responses,
    Last edited by gingerbug; 04-17-2015 at 08:48 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,678

    Re: Assign area to postcode from multiple arrays function

    Try such array formula *in B1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    *...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    09-30-2014
    Location
    Manchester, England
    MS-Off Ver
    2013
    Posts
    5

    Re: Assign area to postcode from multiple arrays function

    Thanks so much, this does in principal work, however when I tried to adapt the formula to use the real data, it seemed to return 'Bolton' for everything. The reason I adapted the formula is because Sheet 2 actually has 10 columns of data (so, ends at J) and the longest length of the column is 99:

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


    Any ideas why it's always returning Bolton for any data?

    Thanks so much, this is excellent by the way!

  4. #4
    Registered User
    Join Date
    09-30-2014
    Location
    Manchester, England
    MS-Off Ver
    2013
    Posts
    5

    Re: Assign area to postcode from multiple arrays function

    I've fixed it! I realised I needed to change the value of A1 in the MAX function!!

    Thanks so much for your help

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,678

    Re: Assign area to postcode from multiple arrays function

    Glad you noted this, and thanks for the rep and for marking thread as solved.

+ 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] 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
  2. Route Run Distances based on postcode area
    By marklister in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-07-2012, 11:33 AM
  3. trying to assign a person to call to a postcode (turns out to be a big problem)
    By operationmayhem in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 08-01-2011, 06:40 PM
  4. Formula to count how much is saved in postcode area
    By blue76 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2010, 03:45 PM
  5. Converting postcode to sales area
    By LarsF in forum Excel General
    Replies: 2
    Last Post: 08-18-2005, 06:05 AM

Tags for this Thread

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