You need to use a specific rate for one night to use the voucher for the other. You could otherwise potentially book a lower rate for both nights. It is really up to you whether the upgraded room is of value or not, and whether you include it in your calculation.
I would calculate it as:
(Total cost using the voucher) - (Lowest cost option you would otherwise book)