I have a table as follows:
From To Bus fare (Rs.)
(km) (km)
0 2 1
2 4 3
4 6 4
6 8 5
8 10 6
10 12 7
12 14 7
14 16 8
16 18 8
18 20 9
20 22 9
22 24 10
24 26 10
26 28 11
28 30 11
30 32 11
32 34 12
34 36 12
36 38 12
38 40 13
The first to columns are km and the third column is bus fare. Now I have a column elsewhere (with about 400 rows) each of which contains a distance value. Baesd on the range, I would like to assign a fare. Eg, if the distance is 5.68km then fare is Rs.4, if distance is 21.09km then fare is Rs.9, and so on. I tried the nested IF, but realised that not more than 7 can be had. I am not sure if VLOOKUP will work as the value being sough is from a range. Please any help to sort this out would be very useful.
Bhargav
PhD candidate
Cambridge University, UK
Bookmarks