COUNTIFS with range in criteria?

BatTodor

New Member
Joined
Feb 10, 2016
Messages
19
I'm trying to count items with ranges as criteria, not a separate value.
Using win this way, it's works:
=LET(
range, INDEX(CA3#, , 54),
uniqueRange, UNIQUE(range),
positions, COUNTIF(range, uniqueRange),
changes, COUNTIFS(range, uniqueRange, INDEX(CA3#, , 16), "Yes"),
percentage, changes/positions,
transport, IF(percentage >= 0.75, "Variant 1", IF(percentage >= 0.5, "Variant 1", "Variant 1")),
table, HSTACK(uniqueRange, changes, positions, transport),
table
)

When I use same approach but in more complex formula (data generate spill range in CA3# in formula above), it's not worked:
=LET(
...
data, HSTACK(dataTable, tempTableWithHeaders, filteredData1, readyTable),

range, INDEX(data, , 54),
uniqueRange, UNIQUE(range),
positions, COUNTIF(range, uniqueRange),
changes, COUNTIFS(range, uniqueRange, INDEX(data, , 16); "Yes"),
percentage, changes/positions,
transport, IF(percentage >= 0.75, "Variant 1", IF(percentage >= 0.5, "Variant 1", "Variant 1")),
table, HSTACK(uniqueRange, changes, positions, transport),
table
)

Receiving message "A value used in the formula is on the wrong data type" on counting - positions and changes.

Any idea?
 
The only way is to output the array to a cell as a spilled range & use that.

Do you mean they are all calculated within the formula you posted? As it it does not show that.
I was think to make calculations with MAP and LAMBDA, but seems that would be slower as calculations.

Do you mean they are all calculated within the formula you posted? As it it does not show that.
Yes, all this array are calculated in the formula before
...
data, HSTACK(dataTable, tempTableWithHeaders, filteredData1, readyTable)

There are more than 40 calculations before combining dataTable, tempTableWithHeaders, filteredData1, readyTable in data array.

In any way, many thanks for information about the way of calculations in HSTACK :)
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
In that case you will not be able to use countifs.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top