Ok, I've been working on a formula to calculate straight-line distance between two zip codes.
It's working well, but I am having a problem getting the formula to work correctly when I try to make the zip code a variable. I'm not sure if using a reference for the first argument in the RIGHT function would cause this or if it's a problem somewhere in the LOOKUP formulas.
Here is the logic that works so long as the zip code is manually typed into a cell in column D:
Miles between 2 zip codes (in column E)=
(The 1.2 is a raw adjustment to get closer to driving miles)
Where:
+
My location addresses are in Column C and include Street, City, State, Zip Code. I would to incorporate logic to pull the zip code from this string so I won't have to manually type the zip code into column D. I can use
too pull this but when I have the RIGHT function in cell D instead of the zip code typed in I get different mileage results in column E and I'm not sure why.
I know that ideally you want data to be seperated out as much as possible but these locations are generated in csv's by our enterprise system and are updated constantly. There's no easy way to get the zip code in a cell all of it's own without having to type it in due to foreign locations, string lengths, etc...
Can anyone identify what it is with the RIGHT function that causes my LOOKUPs to function differently? Is there a better way to get the zip code as a variable?
Bookmarks