Question : Nested IF THEN statements and formulas?  How can I make a long formula or is there a better way.

Hello users,

EXCEL 2003 or 2007  

Here is what I am trying to accomplish.  

I currently fill out a mileage chart every month that I turn in for reimbursement.  We go pretty  much the same routes every month.

I created a formula in Excel that allowed me to type in what I normally do, then it autofilled the mileage.

EXAMPLE:   Cell A1 I created the formula =IF((AND(B1="HS",C1="SSF")),1.1,"")

So, if cell B1 has HS (High School) in it AND cell C1 has SSF (name of another building) in it, then cell A1 will populate with the mileage between the two, which is 1.1 miles.  If either of those two do not have that then it returns nothing to the cell.  Basic basic stuff...yes I know and I probably didnt have to even write that, but trying to give you as much information as I can.

So here is the problem.  I have other destinations we travel.  HS-DO, HS-JH, HS-MD, HS-RS, HS-PCR, HS-LW, HS-LW.   Then all of those locations all have variations...so you see my problem.  I could also be at MD(McDonald) and need to go to each one of those locations, RS, DO, JS, etc etc.  I know the mileage for each of those places, it is already on a chart.

What I was wondering, is there a way to create a spreadsheet that no matter which destination I enter into the B or C cells, the A cell populates with the mileage.

So the chart could look like this

A1      B1     C1
?        HS     DO
?        DO    JH
?        JH     WP
?        WP    MD
?        MD    HS

And everytime I entered in the information into B1 and C1, I would want the mileage populated into A1.
Is this too complicated for Excel?

If it is, what are my alternatives?

If it is not, how do I accomplish such a task?

Thank you in advance, this question is worth 500 points because I believe it is very detailed and asking a lot.

Thanks!
TechNuts

Answer : Nested IF THEN statements and formulas?  How can I make a long formula or is there a better way.

Hello Technuts,

On Patrick's sheet the dropdown picks up all locations shown in Places. Places is a named range which is defined as =Sheet3!$A$2:$A$6

If you add some locations, e.g. down to A10 then if you change the definition of the named range these will automatically appear in the dropdowns. To do that

Insert > Name > Define

click on places and change the definition in the "refers to" box to

=Sheet3!$A$2:$A$10

Random Solutions  
 
programming4us programming4us