Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
Solved

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

Posted on 2014-09-22
Medium Priority
151 Views
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
Question by:Berry Metzger

LVL 27

Accepted Solution

Glenn Ray earned 2000 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

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

## Featured Post

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
###### Suggested Courses
Course of the Month10 days, 14 hours left to enroll