Find a number in set of data allowing for tolerance levels and return text

HelenBunny

New Member
Joined
Sep 23, 2018
Messages
2
Hi,
Hope you can help, I've spent hours trying to figure this out! :)

I have a group students and their addresses with a postal code in one set of data. I'm trying to match them to get work experience at one of our stores based on proximity of location. BUT the students addresses wont exactly match the location so I'd like to allow for a tolerance level. Say 3 postal codes variance up or down.

So e.g if Student A lives in a post code 3010 - I'd like to look up the postal code in the stores locations data and if stores postal code is between 3007 - 3013 then return the stores name from the stores location data, else "No Close Match"

So e.g:

Student
Students SuburbPostal Code
Student 5Sydney2000
Student 6Pyrmont2009
Student 7Surry Hills2010
Student 8Caulfield North2011
Student 9Waterloo2017
Student 10Paddington2021
Student 11Waverley2024
Student 12Rose Bay2029
Student 13Watsons Bay2030
Student 14Clovelly2031
Student 15Maroubra2035
Student 16Glebe2037
Student 17Leichhardt2040
Student 18Leichhardt2040
Student 19Leichhardt2040
Student 20Birchgrove2041
Student 21Enmore2042
Student 22Camperdown2050

<colgroup><col><col><col></colgroup><tbody>
</tbody>


Match to:

StoreStore SuburbStore Postal Code
Store 1Fannie Bay820
Store 2Broadway2007
Store 3Bondi Junction2022
Store 4Coogee2034
Store 5Balmain2041
Store 6Artarmon2064
Store 7Crows Nest2065
Store 8Chatswood2067
Store 9
West Lindfield2070
Store 10Dee Why2099
Store 11
Gladesville2111
Store 12Cherrybrook2126
Store 13Bossley Park2176
Store 14Erina2250
Store 15Castle Hill2275
Store 16Charlestown2290
Store 17Tamworth2340

<colgroup><col><col><col></colgroup><tbody>
</tbody>

Allowing for a vriance in 3 points either way
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hello Helen,

First of all, let us agree on some assumptions ...

1. The first table is in Sheet 1

2. The second table is in Sheet 2

3. In Sheet 1 , Cell D1, you can add header Close Match

4. In Sheet 1, Cell D2, you can test following Array Formula:

Code:
=IF(MIN(ABS((C2-Sheet2!$C$2:$C$18)))<=3,INDEX(Sheet2!$A$2:$A$18,MATCH(MIN(ABS((C2-Sheet2!$C$2:$C$18))),ABS((C2-Sheet2!$C$2:$C$18)),0)),"No Match")

For an Array Formula ... instead of the Enter key ... you need to use simultaneously the three keys : Control Shift Enter

Hope this will help
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,972
Members
448,933
Latest member
Bluedbw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top