samedi 31 mars 2018

IF and LOOKUP formula not giving all of the correct corresponding values

I have a table on the right hand side of the spreadsheet where it looks through the columns T and Z, finding the corresponding value. For instance if Arsenal was on T5 I would want it to get the value for Z5. This formula does it for some of the values but then is giving the wrong values for others and I'm not entirely sure why? It looks like the same syntax for each. Any ideas?

=IF(C2="Arsenal",LOOKUP("Arsenal",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Liverpool",LOOKUP("Liverpool",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Man United",LOOKUP("Man  United",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Man City",LOOKUP("Man City",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Aston Villa",LOOKUP("Aston Villa",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Newcastle",LOOKUP("Newcastle",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Chelsea",LOOKUP("Chelsea",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Everton",LOOKUP("Everton",$T$2:$T$21,$Z$2:$Z$21),IF(C2="West Ham",LOOKUP("West Ham",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Portsmouth",LOOKUP("Portsmouth",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Blackburn",LOOKUP("Blackburn",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Wigan",LOOKUP("Wigan",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Middlesbrough",LOOKUP("Middlesbrough",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Birmingham",LOOKUP("Birmingham",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Sunderland",LOOKUP("Sunderland",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Reading",LOOKUP("Reading",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Fulham",LOOKUP("Fulham",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Tottenham",LOOKUP("Tottenham",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Bolton",LOOKUP("Bolton",$T$2:$T$21,$Z$2:$Z$21),IF(C2="Derby",LOOKUP("Derby",$T$2:$T$21,$Z$2:$Z$21)))))))))))))))))))))

Aucun commentaire:

Enregistrer un commentaire