View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Learning VBA[_3_] Learning VBA[_3_] is offline
external usenet poster
 
Posts: 4
Default Excel Logic needs a Doctor !! FORMULA FIX DESIRED!!

I have the following worksheet setup:
Column A = Origin Column C = Destination Column E = Airline
Cell A2: DTW Cell C2: IAH Cell E2: CO
Cell A3: DTW Cell C3: IAH Cell E3: NW
Cell A4: DTW Cell C4: MCO Cell E4: AA
...........
........
..........
18,900 rows follow with similar type of airline schedule data

My objective is three fold:

1.
cell E2 = CO, and Cell A2 or Cell C2 contains origin/destination as DTW,
or MEM, or MSP, I would like the cell on the sheet i.e. Cell F2 = 0

2.
If cell E3 = NW, and Cell A3 or Cell C3 contains Origin/destination as
DTW, or MEM, or MSP, I would like the cell on the sheet i.e. Cell F3 = 1

3.
Finally, if cell E4 = AA, I would like the cell on the sheet i.e. Cell
F4 = 1

I would like to present an example of what I have done so far to achieve
my objective. Let us take Row 2 as an example where I placed 1 formula
in Cell L2:

=IF(E2="NW","NW",IF(OR(E2="CO"),"CO","OTHER"))

and;
another in Cell M3:

=IF(E2="NW",OR(A2="DTW",A2="MEM",A2="MSP",C2="DTW" ,C2="MEM",C2="MSP"),IF
(OR(E2="CO"),OR(A2="DTW",A2="MEM",A2="MSP",C2="DTW ",C2="MEM",C2="MSP"),"
OTHER"))

The result is completely incoherent. I have been unsuccessful and need
some help with the logic and possibly a new formula. If you could
explain a methodology to achieve my desired outcome, and modify my
formulas, or give me a formula, I would appreciate it.

Thank you Excel gurus...........


Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!