+ Reply to Thread
Results 1 to 7 of 7

Copying/Creating a Zipcode (PostCode) distance checker assistance

  1. #1
    Registered User
    Join Date
    11-11-2024
    Location
    Scotland
    MS-Off Ver
    365 for enterprise
    Posts
    2

    Question Copying/Creating a Zipcode (PostCode) distance checker assistance

    Hello all,


    I was given a postcode checker for the UK. There is a worksheet on the file for all the post codes along with latitude and longitude and I've managed to duplicate this list for the US with the same format. I found a zip code to latitude and replicated the format for the US section that I want to copy over.

    When I attempt to copy over the formulas to calculate the distance and reference the respective locational data, it doesn't work and it presents me with #NA.

    I've attached the list of sample zip/post codes with latitude and longitude.

    When I try to get 'Lat_2' and 'Long_2' to work in the sheet "Multiple US", it comes up as blank for 'Lat_2' and #NA for 'Long_2.' The UK Sheets are working perfectly and I'm not quite sure what I'm doing wrong!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,181

    Re: Copying/Creating a Zipcode (PostCode) distance checker assistance

    You're rying to match a number with text. Try the following:

    =IF(A4="","",VLOOKUP(A4,NA_PostCodes!A$2:D$11,4,0))
    =IF(A4="","",IF(ISNA(VLOOKUP(A4,NA_PostCodes!A$2:D$11,1,0)),"",VLOOKUP(A4,NA_PostCodes!A$2:D$11,3,0)))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,181

    Re: Copying/Creating a Zipcode (PostCode) distance checker assistance

    Or this:

    =IF(B4="","",IF(ISNA(VLOOKUP(B4,--NA_PostCodes!A$2:D$11,1,0)),"",VLOOKUP(B4,--NA_PostCodes!A$2:D$11,3,0)))

    and this:

    =IF(B4="","",VLOOKUP(B4,--NA_PostCodes!A$2:D$11,4,0))

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Copying/Creating a Zipcode (PostCode) distance checker assistance

    I think I posted that file quite some time ago.

    The problem is that your values in column B of the Multiple_US sheet are numeric, whereas in the NA_Postcodes sheet they are text values. You can change the following formulae as shown (in red):

    E4: =IF(B4&""="","",IF(ISNA(VLOOKUP(B4&"",NA_PostCodes!A$2:D$11,1,0)),"",VLOOKUP(B4&"",NA_PostCodes!A$2:D$11,3,0)))

    F4: =IF(B4&""="","",VLOOKUP(B4&"",NA_PostCodes!A$2:D$11,4,0))

    The &"" will convert the column B values to text values, so you can carry on using numbers if you wish. Obviously, copy the formulae down as required.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    11-11-2024
    Location
    Scotland
    MS-Off Ver
    365 for enterprise
    Posts
    2

    Re: Copying/Creating a Zipcode (PostCode) distance checker assistance

    Thanks Pete_UK!

    That's sorted it out, I can't believe I've ran into the author of the file that I was passed along!

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Copying/Creating a Zipcode (PostCode) distance checker assistance

    Glad to help, and thanks for the rep.

    If you are interested, here is a link to the original thread:

    https://www.excelforum.com/excel-tip...alculator.html

    Hope this helps.

    Pete

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,181

    Re: Copying/Creating a Zipcode (PostCode) distance checker assistance

    Well, thanks so much for ignoring my contributions! Post #3 did the same as Pete's.

    It would be appreciated if you would please acknowledge ALL contributors in future. Thanks.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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. Postcode to Postcode Distance re-visited
    By PhilD2GB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-16-2024, 01:00 PM
  2. Formula to automatically assign Postcode (aka ZIPCODE)
    By SupRevDrQ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-20-2015, 06:58 PM
  3. Distance From Main zipcode
    By brazucany in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2014, 03:31 PM
  4. Postcode distance checker
    By KerryLL1221 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 02-21-2014, 08:06 PM
  5. Postcode to postcode distance checker
    By KerryLL1221 in forum Excel General
    Replies: 1
    Last Post: 02-21-2014, 09:42 AM
  6. Distance from Postcode
    By sitay1984 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2013, 07:12 AM
  7. Distance from Postcode
    By sitay1984 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2013, 06:12 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