the logic is to add 10bn to the SQRT result wherever, either, a) the Level (A <>A3) or b) Utility (B <> C3) do not match the criteria (if neither match you will add 20bn) -- so, the invalid rows will return meaningless results in context of outer MIN calculation. However, if it's possible to not have any valid results you would still get rogue results with this approach as the MIN would be taken from one of the >10bn results, hence the pre-emptive COUNTIFS test.
You could also adopt a slightly different approach using something like the below:
in this instance, both the FILTER and AGGREGATE will only reference valid rows, returning #NUM! where no valid result exists (handled via IFERROR)
the outer INDEX is just to handle possibility of FILTER returning more than 1 record (should 2 valid rows return identical SQRT)
Bookmarks