Hi there! Hoping you can help out
I'm trying to get an array into the criteria of a COUNTIFS function.
Here is a sample of the data:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Type[/TD]
[TD]Location[/TD]
[TD]Progress[/TD]
[/TR]
[TR]
[TD]Name_1[/TD]
[TD]Type_1[/TD]
[TD]Location_1[/TD]
[TD]Stage_1[/TD]
[/TR]
[TR]
[TD]Name_2[/TD]
[TD]Type_1[/TD]
[TD]Location_3[/TD]
[TD]Stage_2[/TD]
[/TR]
[TR]
[TD]Name_3[/TD]
[TD]Type_2[/TD]
[TD]Location_1[/TD]
[TD]Stage_4[/TD]
[/TR]
[TR]
[TD]Name_4[/TD]
[TD]Type_3[/TD]
[TD]Location_2[/TD]
[TD]Stage_4[/TD]
[/TR]
</tbody>[/TABLE]
I'd like a COUNT of how many rows are of a particular 2, and fall within a set of preferred locations and preferred stages.
In this example, the preferred locations are Location_1 and Location_2 and the preferred stages are Stage_3 and Stage_4.
Currently, I'm having to use multiple lines:
This would return an answer of 1 which would be from Name_3.
The aim is to have in another sheet, a table with 2 headers; PreferredLocations and PreferredStages, listing below the relevant info.
I'm hoping you'll be able to help in condensing the above function down into a more dynamic function in a single line:
But the above doesn't work because of the Named Ranges 'PreferredLocations' and 'PreferredStages'. Using Cell Ranges instead of Names Ranges encounters the same error.
The closest similar question I've found was at https://www.mrexcel.com/forum/excel...s-function-criteria-cell-reference-range.html but I couldn't get it to work for me.
I suspect the answer will be some sort of SUMPRODUCT or QUERY.
Really looking forward to hearing any suggestions/advice!
Thanks
I'm trying to get an array into the criteria of a COUNTIFS function.
Here is a sample of the data:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Type[/TD]
[TD]Location[/TD]
[TD]Progress[/TD]
[/TR]
[TR]
[TD]Name_1[/TD]
[TD]Type_1[/TD]
[TD]Location_1[/TD]
[TD]Stage_1[/TD]
[/TR]
[TR]
[TD]Name_2[/TD]
[TD]Type_1[/TD]
[TD]Location_3[/TD]
[TD]Stage_2[/TD]
[/TR]
[TR]
[TD]Name_3[/TD]
[TD]Type_2[/TD]
[TD]Location_1[/TD]
[TD]Stage_4[/TD]
[/TR]
[TR]
[TD]Name_4[/TD]
[TD]Type_3[/TD]
[TD]Location_2[/TD]
[TD]Stage_4[/TD]
[/TR]
</tbody>[/TABLE]
I'd like a COUNT of how many rows are of a particular 2, and fall within a set of preferred locations and preferred stages.
In this example, the preferred locations are Location_1 and Location_2 and the preferred stages are Stage_3 and Stage_4.
Currently, I'm having to use multiple lines:
Code:
[COLOR=#000000][FONT=Inconsolata]=[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]COUNTIFS[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]([/FONT][/COLOR][COLOR=#F7981D][FONT=Inconsolata]B:B[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#7E3794][FONT=Inconsolata]"Type_2"[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#11A9CC][FONT=Inconsolata]C:C[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][FONT=Inconsolata][COLOR=#008000]"Location_1"[/COLOR][/FONT][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#A61D4C][FONT=Inconsolata]D:D[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][FONT=Inconsolata][COLOR=#008000]"Stage_3"[/COLOR][/FONT][COLOR=#000000][FONT=Inconsolata])
[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]+COUNTIFS([COLOR=#F7981D]B:B[/COLOR],[COLOR=#7E3794]"Type_2"[/COLOR],[COLOR=#11A9CC]C:C[/COLOR],[COLOR=#008000]"Location_1"[/COLOR],[COLOR=#A61D4C]D:D[/COLOR],[COLOR=green]"Stage_4"[/COLOR])
+COUNTIFS([COLOR=#F7981D]B:B[/COLOR],[COLOR=#7E3794]"Type_2"[/COLOR],[COLOR=#11A9CC]C:C[/COLOR],[COLOR=#008000]"Location_2"[/COLOR],[COLOR=#A61D4C]D:D[/COLOR],[COLOR=green]"Stage_3"[/COLOR])
[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]+[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]COUNTIFS[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]([/FONT][/COLOR][COLOR=#F7981D][FONT=Inconsolata]B:B[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#7E3794][FONT=Inconsolata]"Type_2"[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#11A9CC][FONT=Inconsolata]C:C[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][FONT=Inconsolata][COLOR=#008000]"Location_2"[/COLOR][/FONT][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#A61D4C][FONT=Inconsolata]D:D[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=green][FONT=Inconsolata]"Stage_4"[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata])[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]
[/FONT][/COLOR]
This would return an answer of 1 which would be from Name_3.
The aim is to have in another sheet, a table with 2 headers; PreferredLocations and PreferredStages, listing below the relevant info.
I'm hoping you'll be able to help in condensing the above function down into a more dynamic function in a single line:
Code:
=COUNTIFS([COLOR=#F7981D][FONT=Inconsolata]B:B[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#7E3794][FONT=Inconsolata]"Type_2"[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#11A9CC][FONT=Inconsolata]C:C[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][FONT=Inconsolata][COLOR=#008000]PreferredLocations[/COLOR][/FONT][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#A61D4C][FONT=Inconsolata]D:D[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=green][FONT=Inconsolata]PreferredStages)[/FONT][/COLOR]
But the above doesn't work because of the Named Ranges 'PreferredLocations' and 'PreferredStages'. Using Cell Ranges instead of Names Ranges encounters the same error.
The closest similar question I've found was at https://www.mrexcel.com/forum/excel...s-function-criteria-cell-reference-range.html but I couldn't get it to work for me.
I suspect the answer will be some sort of SUMPRODUCT or QUERY.
Really looking forward to hearing any suggestions/advice!
Thanks