![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Vancouver, BC
Posts: 2
|
Here is a clarification on my origial posting. I made a couple of errors initially.
Column A represents the departure location Column B represents the arrival location Column C I want to represent the route. A_____B_____C Dep___Arr___Route 2007__2002 2003__2001 2001__2003 2005__2007 2005__2007 2003__2001 2001__2003 2007__2005 the route code array is below: ______________Destination Origin ________2001____2002____2003____2005____2007 2001____________________2 2002____________________________________3 2003____2 2005____________________________________1 2007____________3_______________1 So going from 2007 to 2002 will be route 3. Similarily, going in reverse, from 2007 to 2002 will also be route 3. Somehow, using the INDEX function, I should be able to enter a function to display either 1, 2 or 3 in Column C. [ This Message was edited by: Sager on 2002-05-21 15:43 ] |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Can you define what the origin and destinations are for the acutal routes i.e. what routes 1, 2, and 3 are.
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
How could Route 1 be "D" to "A" when "D" isn't listed as an origin?
|
|
|
|
|
|
#4 | ||
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
I have an answer for you but it is very dependent on how your sheet is setup.
I assumed the following data was A1:C9 where row 1 contains the headings Dep, Arr, Route. Quote:
Quote:
=OFFSET($A$11,MATCH(A2,$A$12:$A$16,0),MATCH(B2,$B$11:$F$11,0)) or =INDEX($A$11:$F$16,MATCH(A2,$A$11:$A$16,0),MATCH(B2,$A$11:$F$11,0)) or using Yogi's suggestion with my ranges: =VLOOKUP(A2,$A$11:$F$16,MATCH(B2,$A$11:$F$11),FALSE) Tell me if there are any problems. _________________ Hope this helps. Kind regards, Al. [ This Message was edited by: Al Chara on 2002-05-21 17:06 ] [ This Message was edited by: Al Chara on 2002-05-21 17:44 ] |
||
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
=VLOOKUP(A2,$A$20:$F$25,MATCH(B2,$A$20:$F$20,0),0) Regards! _________________ Yogi Anand Edit: Deleted inactive website from hardcoded signature [ This Message was edited by: Yogi Anand on 2003-01-19 13:02 ] |
|
|
|
|
|
|
#6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Reproduced below is a simulation of the worksheet with the VLOOKUP solution:
Click on a hyperlinked cell to view the underlying formula
__________________
Regards! Yogi Anand, D.Eng, P.E. Energy Efficient Building Network LLC www.energyefficientbuild.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
#7 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Yogi, you have your route matrix setup wrong, but your formula will work if it is fixed.
[ This Message was edited by: Al Chara on 2002-05-21 17:51 ] |
|
|
|
|
|
#8 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Hi Al:
My route matrix is in cells A20:F25 -- Ya! I seeit now, it is in the last line -- it should have been route 3 from 2007 to 2002 and not 2001. Thanks for keeping me honest! |
|
|
|
|
|
#9 |
|
New Member
Join Date: May 2002
Location: Vancouver, BC
Posts: 2
|
Awesome!
Amazing responsiveness. Thanks a million! Till next time (and there will be a next time, assured), Sager |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|