View Single Post
Old 06-23-2009, 07:23 AM   #2 (permalink)
ShosMeister
Registered User
 
Join Date: Jan 2008
Location: Harpers Ferry, WV
Posts: 400
OS: OS X 10.4.x


Re: Excel formula to match a number from a selection of data (OR and IF function)

You had an extra ) in there after your 140 before the last IF. Aligning the (...) helped to find it. I also took out the extra ( that you have before all the IFs.

Code:
=IF(
     OR(I4="Hatfield", I4="Huntingdon", I4="Letchworth"),
     90,
     IF(
         OR(I4="Bedford", I4="Flitwick", I4="Stevenage"),
         125,
         IF(
             OR(I4="Downham Market", I4="Kings Lynn"),
             70,
             IF(
                 OR(I4="Luton", I4="LAP", I4="Luton Airport Parkway", I4="St Albans", I4="St Albans & Harpenden"),
                 140,
                 IF(
                     I4="Hitchin",
                     100,
                     "INVALID VALUE"
                   )
               )
           )
       )
   )
ShosMeister is offline   Reply With Quote