Try this. It is not tested so if any problem please reply.
select A.Rack,
(select Sum(B.Qty) from tablename B where B.Rack =A.Rack and B.Cell ='X') as 'X',
(select Sum(B.Qty) from tablename B where B.Rack =A.Rack and B.Cell ='Y') as 'Y',
(select Sum(B.Qty) from tablename B where B.Rack =A.Rack and B.Cell ='Z') as 'Z',
Count(A.Rack)
from tablename A
group by A.Rack