excel-indirect

Excel Indirect command returns #value


Using COUNTIF to count the number of times the value "HW or SW" shows up in a column. I am not sure how many rows of data I will end up with so I want to make that a variable, using INDIRECT. This formula returns a #VALUE error and I cannot figure out why: =COUNTIF('Daily_Data_Dump'!$G$2:INDIRECT("$G"&AB3),"HW_or_SW") Where the value in cell "AB3" is 5000. In my mind is should be the equivalent of =COUNTIF('Daily_Data_Dump'!$G$2:$G5000,"HW_or_SW"). Thanks for any help.


Solution

  • "In my mind is should be the equivalent of =COUNTIF('Daily_Data_Dump'!$G$2:$G5000,"HW_or_SW")."

    That is correct, the problem is something else. The adress is wrong, try:

    =COUNTIF('Daily_Data_Dump'!$G$2:INDIRECT("Daily_Data_Dump!$G"&AB3),"HW_or_SW")