Generate Formula from Sample Data