Forum

Notifications
Clear all

How to highlight every other group of rows in a filtered range?

4 Posts
2 Users
0 Reactions
215 Views
(@darkwing1711)
Posts: 31
Trusted Member
Topic starter
 

Hello all!

Long story short, I am able to conditional format a range to highlight every other group in an unfiltered range.  But I am having a hard time doing it for a filtered range.

For example.  For the filtered range below, I want item 1 and item 4 highlighted.

Sample.jpg

Thanks in advance!

 
Posted : 08/11/2022 11:34 am
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

If I understand you correctly you want to be able to always highlight alternating groups in a table. Filtered or unfiltered.

Thus, when you filter out Item 4, then Items 1 and 7 should be formatted.

Perhaps there's another way but I came up with one that requires two helper columns that may be hidden.

One that determines if the row is visible or not and another that sets TRUE or FALSE that will be the basis for the conditional formatting rule. See if you can get this implemented in your own schedule, provided my assumptions were correct of course!

Screenshot-2022-11-08-105623.png

See attached.

Edit: In order to use consistent structured table references, the formula in the cf column should actually be

=ISODD(MATCH([@Ref],UNIQUE(FILTER([Ref],[visible]=1),0)))

 
Posted : 09/11/2022 5:59 am
(@darkwing1711)
Posts: 31
Trusted Member
Topic starter
 

This is great!  Works great with a table range.  Any idea on how to do this for a spilled range?  Aggregate doesn't seem to like spilled ranges 🙁

I'm using a spilled range because the rows of data isn't always the same.  I "could" put a macro to add or delete rows, but rather make it dynamic and based on the data.

Thanks again!  If all else fails, I'm gonna use this.

 
Posted : 10/11/2022 10:57 am
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

Ah, I see. If your Excel version supports LAMBDA (and helper functions), you can put AGGREGATE in a BYROW/LAMBDA function to make it spill as demonstrated in the picture.

Screenshot-2022-11-10-at-05.57.37.png

 
Posted : 11/11/2022 1:02 am
Share: