Hello usha,
I have assumed that you data layout is exactly as shown on one sheet with one column between tables. Your first calculated cell will be AD4. The following formula copied down and across will do what you want leaving blanks where appropriate.
=IF(ISNA(VLOOKUP($AC4,$A$4:$M$19,COLUMN()-COLUMN($AB$4),0)),"",IF(P4>0,VLOOKUP($AC4,$A$4:$M$19,COLUMN()-COLUMN($AB$4),0)/VLOOKUP($AC4,$O$4:$Z$29,COLUMN()-COLUMN($AB$4),0),""))
Regards
Harry