Solved

# How to modify SubTotal formula to also count cells with "DONE"?

Posted on 2011-10-10
206 Views
Hello experts,
See my attached example.  I have formulas that count cells with dates and ignores N/A.  The formulas now need to include cells with "DONE".  (Formulas need to work when rows are filtered.)

Help?

Gary
Training-Records-Planner-Master-.xls
0
Question by:garyrobbins

LVL 37

Expert Comment

You mean the formulas in columns S and T? I opened your file and they are counting both the fields with date and "DONE"?
0

Author Comment

Sorry for not being more clear...  The formulas in rows 28 & 30.  Gary
0

LVL 5

Expert Comment

COUNTIF is the command you looking for i think.
http://www.contextures.com/xlfunctions04.html

Look for CountIF
0

LVL 50

Accepted Solution

I don't think COUNTIF will work because the count needs to look at the visible rows only. Try these Gary

..... in M28 copied across

=SUBTOTAL(2,M10:M25)+SUMPRODUCT((M\$10:M\$25="Done")*SUBTOTAL(3,OFFSET(M\$9,ROW(M\$10:M\$25)-ROW(M\$9),0,1,1)))

and for M30

=SUMPRODUCT((M\$10:M\$25>=\$A\$2)*ISNUMBER(M\$10:M\$25)+(M\$10:M\$25="Done"),SUBTOTAL(3,OFFSET(M\$9,ROW(M\$10:M\$25)-ROW(M\$9),0,1,1)))

regards, barry
0

LVL 50

Expert Comment

Hello,

I don't quite understand the rules that lead to "Training required" = 13 in row 28 and at the same time have "Training current" with 10 in row 30.

From the formulas you're using I gather you could use in row 28

=COUNTIF(M10:M25,"<>NA")

and in row 30
=SUMPRODUCT(((ISNUMBER(M\$10:M\$25))*(M\$10:M\$25>=\$A\$2))+(M\$10:M\$25="Done"),--(M\$10:M\$25<>""))

cheers, teylyn
0

Author Closing Comment

Thanks, Barry!  That's what I wanted...

Gary
0

## Featured Post

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…