As I mentioned recently (here), we can do COUNTIF sums in Excel. However, a COUNTIF sum will include everything in the range, even if you are using an autofilter over your data. If there are 15 cells in total with the value you seek, but only 5 showing in the filtered range, COUNTIF will take no notice of the filter and keep returning 15.
To sum only filtered results, once we have autofiltered our data, we then simply select a particular autofilter aspect that we are interested in - for example, specifying a "contains" from the dropdown list on each autofilter column header.
Then, in our dashboard above our data (I always keep a few row free at the top of a spreadsheet for this) we can show the values - count, averages, sum - we seek using the subtotal function, and a number to indicate exactly what value it is that we want. "1" will average; "2" will give a count of numbers; "3" will return a count of text; "9" will sum (see a list of all these conditions here).
You can get a lot more complicated with this, but in general, autofilters and the 'contains' function will get us a COUNTIF without headaches.
Sam
To know more, go to:
- Cheusheva, S. (1 May 2018). COUNTIF in Excel - count if not blank, greater than, duplicate or unique. Retrieved from https://www.ablebits.com/office-addins-blog/2014/07/02/excel-countif-examples/#countif-blank
- GoogleSearch (14 January 2019). How do i do a countif in excel on a formula. Retrieved from https://www.google.co.nz/search?q=how+do+i+do+a+countif+in+excel+on+a+formula&rlz=1C1GGRV_enNZ761NZ761&oq=how+do+i+do+a+countif+in+excel+on+a+formula&aqs=chrome..69i57.34813j0j8&sourceid=chrome&ie=UTF-8
- Langmann, K. (n.d.). How To Use The COUNTIF Function in Excel (+COUNTIFS). Retrieved from https://spreadsheeto.com/countif-countifs/
- Rockerfeller, N. T. (11 September 2011). How to use countif with subtotal. Retrieved from https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-use-countif-with-subtotal/de09fe89-6d98-4691-a25b-19b1a1e74bf2
No comments :
Post a Comment
Thanks for your feedback. The elves will post it shortly.