To calculate the put-call ratio one needs to check the open interst of puts and calls and divide it! But we have different puts and different calls so how it is calculated?

Do not do so much math, just type nifty put call ratio live on google even in live market, iifl site came , open it , there the ratio

Sum of the total OI of different Put and calls. An excel sheet for OI analysis with realtime update from NSE.
https://www.facebook.com/download/1623525171256576/NIFTYmain.xlsm

PCR is a ratio of Traded contracts, i.e, it is ratio of Put volume by Call Volume (not Open Interest). Also, multiple strikes of Puts + Calls, as well as different calender month contracts are taken for calculating PCR.

http://www.investopedia.com/ask/answers/06/putcallratio.asp

Also, there are several types of PCR.

http://www.cboe.com/publish/oicommentary/rr_11_24_11.pdf

Not OI . .volume.