INDIRECT in COUNTIFS and SUMPRODUCT returing error, despite working when they are the only arguments

halinc

New Member
Joined
Nov 7, 2013
Messages
20
Office Version
  1. 2016
Platform
  1. Windows
I have the name of the start of a range in Q1, name of the end of the range in Q2 (for example: Q1 = "Data!$Y$2", Q2 = "Data!$Y$2000"). I have a criteria in F2 (for example: "Canada").

I have some existing COUNTIFS and SUMPRODUCTS set up like below (using named ranges/cells):
=COUNTIFS(EmpType,"Regular",HireDate,"<="&SOP)
=SUMPRODUCT(--(EmpType="Regular"),--(LatestHire<=SOP))

I want to add new criteria, to product something like this:
=COUNTIFS(EmpType,"Regular",HireDate,"<="&SOP,INDIRECT($Q$1):INDIRECT($Q$2),$F$2)
=SUMPRODUCT(--(EmpType="Regular"),--(LatestHire<=SOP),--(INDIRECT($Q$1):INDIRECT($Q$2)=$F$2))

However, these produce an error (#VALUE!).

This is despite the fact that formulas ONLY containing these arguments work correctly:
=COUNTIFS(INDIRECT($Q$1):INDIRECT($Q$2),$F$2)
=SUMPRODUCT(--(INDIRECT($Q$1):INDIRECT($Q$2)=$F$2))

<colgroup><col style="width:96pt" width="128"> </colgroup><tbody>
</tbody>

Does anyone know what the issue might be?

Thanks!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Are you sure the ranges are the same size and shape as the values you are using in INDIRECT?
 
Upvote 0
Thanks, I was able to fix by just using the entire column.
Solved.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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