Quote Originally Posted by Kenneth Hobson View Post
Welcome to the forum!

=SUBTOTAL(109,F2:F12)
Thank you Mr. Kenneth for your help, but unfortunately the formula didn't fit my demand

Here is a solution from a friend;

The formula is:

=SUMPRODUCT(SUBTOTAL(109;OFFSET(F3;ROW($F$3:$F$12)-ROW(F3);;1));--($D$3:$D$12="M"))

Thank you all for your help