View Single Post
  #2   Report Post  
KL
 
Posts: n/a
Default

Hi,

Assuming that the searched phone number and the ones in the table are either
numeric values or text at the same time, if you change your table to the
below a formula like =VLOOKUP(D1,A1:B10,2) should work:

0121000000 25
0121200000 26
0121240000 27
0121249000 27
0121249357 24
0130000000 24
0131000000 25
0131200000 26
0131246300 27
0131246452 24


Regards,
KL


"taran" wrote in message
...

Hi,

I have a spreadsheet which looks a bit like this..

Phone number cost

0121 25
01212 26
012124 27
0121249 27
0121249357 24
013 24
0131 25
01312 26
01312463 27
0131246452 24

im sorry but my example table is not very good. fyi the numbers after
the space in each row should be the next column...

I need to find a way to cost the phone numbers i enter
eg. if i need to find out how much 0121249357 will cost it will tell
me 24 but if i need to find 0121249367 i need it to find 27 (0121249)

is there a way i can get excel to look thru a string of say 9 digits,
but if it doesnt find a match then look thru the 1st 8 digits, then 7,
then 6 till it finds a match???

sorry if im not very clear but i dont really know excel or the
terminology very well.

would be very grateful if some1 could help.

Thanks,

Taran


--
taran
------------------------------------------------------------------------
taran's Profile:
http://www.excelforum.com/member.php...o&userid=25724
View this thread: http://www.excelforum.com/showthread...hreadid=391338