This should be doable with the ISTR function. Look it up.