finding a single value in one tab, within a range in another tab

Andy Wiles

New Member
Joined
Jun 29, 2018
Messages
1
Hi,

I'm way stumped on this one so wondering if anyone can help out.

Not sure if i can attach a file anywhere so i'll explain.

tab 1,,
a list of phone numbers in column A so something like

02077481000
02077481001
02077481003 etc etc, list is hundreds of thousands of lines long.

tab 2,,,
A list of ranges

02077481000 - 02077481025
02077481030 - 02077489999 etc etc, again a massive list of ranges.

i want to put a formula next to each of the individual numbers in Tab 1, which basically looks up if the single number is listed within tab 2.

Prob i have is that a vlookup will recognize that if i'm looking for 02077481000 then its there, But if i do the same lookup on 02077481001
is had no concept of this number falling within the range of 02077481000 - 02077481025.

hopefully that makes sense ?

many thanks in advance

Andy
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
this works with helper columns


Excel 2013/2016
ABCDEF
102077481001match02077481000 - 0207748102520774810002077481025
202077481105match02077481026 - 0207748105020774810262077481050
30207750110102077481051 - 0207748107520774810512077481075
402077481076 - 0207748110020774810762077481100
502077481101 - 0207748112520774811012077481125
602077481126 - 0207748115020774811262077481150
702077481151 - 0207748117520774811512077481175
802077481176 - 0207748120020774811762077481200
Sheet2
Cell Formulas
RangeFormula
E1=TRIM(LEFT(SUBSTITUTE(D1,"-",REPT(" ",500)),500))*1
F1=TRIM(RIGHT(SUBSTITUTE(D1,"-",REPT(" ",500)),500))*1
B1=IF(SUMPRODUCT(((A1*1)>=$E$1:$E$8)*((A1*1)<=$F$1:$F$8))=1,"match","")
 
Last edited:
Upvote 0
Here's one way


Book1
ABCDEF
1020774810002102077481000 - 0207748102521
2020774810012102077481030 - 0207748999912
3020784834562302077491030 - 0207749999924
4020774911332402078481030 - 0207848999923
Beta (9)
Cell Formulas
RangeFormula
B1=SUMPRODUCT((A1>=LEFT($E$1:$E$4,SEARCH(" - ",$E$1:$E$4)-1))*(A1<=RIGHT($E$1:$E$4,LEN($E$1:$E$4)-SEARCH(" - ",$E$1:$E$4)-2))*($F$1:$F$4))


Am using same sheet here, but the idea is the same
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

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