Forum Discussion
Per
Jan 23, 2025Copper Contributor
Sorting numbers
Hi, I have a excel sheet with x number of columns. I have formated the rows so that if there is a specific number it is marked in red. See picture below. The numbers that are marked are Top row ...
- Jan 24, 2025
The formula needs to match the logic used in your Conditional Formatting rules. Based on your screenshots, I believe you meant to say the rule for the Top Row is "0 - 2 and 9 - 13. So, numbers 3-8 shall not be marked".
Also, I think the logic just needs to be reversed from what's already been suggested. Try either:
=SUM(N(NOT(BYCOL((A1:AI3<{3;1;2})+(A1:AI3>{8;5;6}),OR))))
Or:
=SUM(BYCOL((A1:AI3>{2;0;1})*(A1:AI3<{9;6;7}),PRODUCT))
See attached...
Patrick2788
Jan 23, 2025Silver Contributor
Here's my solution:
=SUM((matrix<{4;1;2})+(matrix>{8;5;6}))
Matrix being the designated range in the sheet.
Per
Jan 23, 2025Copper Contributor
This looks promising.
But I want only to count the columns that have no red mark. So in your exampel the count is 0. In my first picture the count is 2. In my picture below there are nine columns that are not marked in any of the three rows.
- djclementsJan 24, 2025Bronze Contributor
The formula needs to match the logic used in your Conditional Formatting rules. Based on your screenshots, I believe you meant to say the rule for the Top Row is "0 - 2 and 9 - 13. So, numbers 3-8 shall not be marked".
Also, I think the logic just needs to be reversed from what's already been suggested. Try either:
=SUM(N(NOT(BYCOL((A1:AI3<{3;1;2})+(A1:AI3>{8;5;6}),OR))))
Or:
=SUM(BYCOL((A1:AI3>{2;0;1})*(A1:AI3<{9;6;7}),PRODUCT))
See attached...
- PerJan 25, 2025Copper Contributor
Thank you! Thank you! Thank you! This functions do the work