Your question is not clear, however
Assuming your Levels are in Col A, indicated by 1,2,3,4
Col B indicates whether it is a cost by "C" and Sum by "S"
and you have acutal values in Col C,
then you can sum up cost at a given level
=SUMPRODUCT(--(A1:A100=D1),--(B1:B100="C"),(C1:C100))
where D1 contains the level (1,2 ,3 or 4)
If you want to sum level 3 AND 4 then you can have
=SUMPRODUCT(--(A1:A100>D1),--(B1:B100="C"),(C1:C100))
with D2 having the value 2