Basis risk is the variance of the basis, where basis is the difference between spot and futures price. Or, here I've just replaced future (F) with (hedge ratio * Future).
The minimum variance hedge ratio (h*) is then the hedge ratio (the special case of the hedge ratio) that happens to minimize the basis risk; and we can find that by taking the first derivative of basis risk (with respect to the hedge ratio).
Spreadsheet is available at our website.