How to substract using sumif.

  • Thread starter Thread starter wendy
  • Start date Start date
W

wendy

Ok, I have found out to sum the totals, however, I will
like for this formula to substract Lunch. I will real
real appreciate any help. This formula does not work.

c.Offset(6, 1).Formula = "=Sumif(" & rng1.Offset(0,
2).Address & _
",""LUNCH""," & rng1.Offset(0, 4).Address & ")"
 
Sorry this is the formula: the sum total should subtract
lunch

"=Sum(" & rng1.Offset(0, 4).Address & ")"-sumif((" &
rng1.Offset(0, 2).Address & _
",""LUNCH""," & rng1.Offset(0, 4).Address & ")"
 
Wendy,

This is what I think you want

"=SUM(" & rng1.Offset(0, 4).Address & _
")- SUMIF(" & rng1.Offset(0, 2).Address & _
",""LUNCH""," & rng1.Offset(0, 4).Address & ")"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top