I need a formula to retrieve a formula (not a result) from a range of cells. this is the formula i need to work:

IF(H9=L,(IF(K9<20,79,IF(K9<39,89,IF(K9<59,99,IF(K9<78,109,IF(K9>77,119)))))), IF(H9=D,( IF(K9<88,99,IF(K9<98,109,IF(K9<108,119,IF(K9<118,129,IF(K9>117,139)))))),IF(H9=M,( IF(K9<127,139,IF(K9<137,149,IF(K9<147,159,IF(K9<157,169,IF(K9>156,179)))))),IF(H9=H,( IF(K9<167,179,IF(K9<172,199,IF(K9<178,219,IF(K9<184,239,IF(K9>238,259)))))))