Solved

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

Posted on 2014-09-22
2
135 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

948 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now