sight
I have 2 columns and hundreds of rows, in the column I have "Yes" or "No".
I have created an autofilter on column ("country") and I want to know how many "Yes" and "No" answer I get for each column when I apply the filter, since countif ignores hidden rows I thought I can use subtotals but subtotals does not support countif....
ie:
Country Yes/No Column
IN No
IN No
IN No
GB No
GB No
GB Yes
GB Yes
GB Yes
when I apply the filter "IN" I only want to count "IN" "yes and "no" values.
so I get IN = 3 no and 0 yes... not 3 yes and 5 no due to countif ignoring the filter.
can somebody help?
Assuming your table is in A1:B9, then for "No" try:
adjust ranges to suit.Code:=SUMPRODUCT(SUBTOTAL(3,OFFSET($B$2:$B$9,ROW($B$2:$B$9)-MIN(ROW($B$2:$B$9)),,1)),--($B$2:$B$9="No"))
Change "No" to "Yes" in last argument for count of "Yes"
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
This works, except for cells with empty values that you are trying to count, too.
I enclose an example
in C1 is an example of the solution formula, testing for empty cell. doesn't work.
in D1 is an example of the solution formula, testing for "N". works.
My intent is to put both into an IF statement, to alert me if the long list contains a specific value.
Can anybody assist? that is, make it work for "" and non-"" values?
you could use some helper columns and convert those to numbers ,say in col c if(or(b2={"y","n"}),1,0)
then subtotal on those instead
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks