What you are doing wrong is nesting more than 7 conditions in an If
statement. You will find that this level of nesting makes the formula
virtually unmaintainable. There's always a better way, the most common
solution being Vlookup.
If I have understood your query correctly for an IF Function to have maximum
nesting , please try this:
=IF(criteria1= something ,desired value1," ")&IF(criteria 2=
something,desired value2," ").............. &IF(criteria 19= something
,desired value 19,desired value 20)
Pl try the maximum you can reach and let us know.