Solved

Formula that returns any unique, visible value using AutoFilter or returns "All" if multiple values are visible

Posted on 2014-09-22
2
138 Views
Last Modified: 2014-09-22
Hello Experts,

Increase flexibility of my IF(SUBTOTAL formula (or any formula) to return ALL (ANY) unique value, beyond the current, limited design of just returning three results, Team "1" or "2", or, if AutoFilter is set to show more than one Team, then "All" is returned.  The current IF(SUBTOTAL operates with only two Teams, 1 and 2.   A new design will return *ANY, UNIQUE* Team number (value) when a filter is set on Column B.  

The purpose is to cause a chart title to properly reflect exactly which Team number, [1, 2, 3, ...n] has been filtered [is visible] when only a single team is [uniquely] visible.  Otherwise, "All" (meaning several) is returned signifying more than one team has been selected with AutoFilter.
 
I prefer a non-array formula solution if calculation will be excessively slow.  
A .XLSX file is attached with needs detail and to experiment on.
Thanks,
Berry
IF-SUBTOTAL-Formula-with-more-capability
0
Comment
Question by:Berry Metzger
2 Comments
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 40338101
Here is a non-array function that will display the team number when a single team is selected:
=IF(AND(SUBTOTAL(104,$B$5:$B$206)=SUBTOTAL(105,$B$5:$B$206)),SUBTOTAL(104,$B$5:$B$206),"All")

I'm comparing the MIN and the MAX of the SUBTOTAL results; if they are the same, then only one team is filtered and its value is shown in the cell.

Regards,
-Glenn
0
 

Author Closing Comment

by:Berry Metzger
ID: 40338195
That works!  Good job.
Thanks Glenn
Berry
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question