Notional principal on an interest rate swap

We have NP = value of portfolio x (MDtarget - MDportfolio)/MDswap Text says this is a variation of the basic bond hedging formula, but how do we get to the above from the below? ((MDtarget - MD portfolio)/ MDfuture) x (value portfolio / futures price)

Original Formula =>

of Futures Contracts = ((MDtarget - MD portfolio)/ MDfuture) x (value portfolio / futures price)

in the case of a Swap => # of Swaps = 1

So 1 = ((MDtarget - MD portfolio)/ MDSwap) x (value portfolio / Swap price)

Swap Price = NP

So NP = (MDtarget - MD portfolio)/ MDSwap x (value portfolio)