Link to home
Start Free TrialLog in
Avatar of ContechBridge
ContechBridgeFlag for United States of America

asked on

How do I countif a range of cells that is not adjacent?

Several Excel functions require you to have the RANGE or Array of cells be adjancent to each other (A1:A6)....what if my Range or Array is A1, A6, A8, A9, etc.?

I don't want to create a named range for all 400 rows....which is what I am looking at now...

Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

The answer might differ depending on the function. COUNTIF, for instance won't even allow you to use a named range if that range is made up of non-adjacent cells.

Is there a pattern, e.g. every 3rd cell? You can then write a formula to count "x" only within every third cell, or simpler, if you have an adjacent column which somehow identifies which rows are included then you can use a SUMPRODUCT or COUNTIFS function

regards, barry
Avatar of ContechBridge

ASKER

I want to find the MIN of the following cells that DO NOT contain "0"

Q6,S6,U6,AA6,AG6,AM6,AS6
ASKER CERTIFIED SOLUTION
Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forgive my ignorance here but, just adding the "()" to the range of non adjancent cells makes it the LARGE function work with non adjacent cells...?

Everything after that is just defining the "K" criteria?
The parentheses are actually the Union operator. Some (but far from all) functions will work on a union of non-contiguous cells. This union is then treated as a single parameter--a range (with multiple areas)--by the union-savvy functions. So in barryhoudini's suggested LARGE formula, (Q6,S6,U6,AA6,AG6,AM6,AS6) is the union of the seven cells.

Excel also has an Intersection operator--which is the space character. So A1:A6 A3:D4 would return the intersection of those two ranges: cells A3 and A4. Once again, not all functions are intersection-savvy.

Brad