Use =INDIRECT()
=COUNTIF(INDIRECT(C4&"!A2:A550"),C3)
By using INDIRECT()
you can string together the range address as a string; Excel will interpret the range address from the string you provide.
Pergunta
I am working on a project just on Excel, not using VBA. I am trying to use a COUNTIF function to count the number of times C3
(the user types what they want to search into C3
). I have four spreadsheets to search, the name of the spreadsheet the user wants to search is typed into С4
. So the formula I have right now is =Countif('C4'!A2:A550,C3)
.
This doesn't work. Any suggestions?
Solução
Use =INDIRECT()
=COUNTIF(INDIRECT(C4&"!A2:A550"),C3)
By using INDIRECT()
you can string together the range address as a string; Excel will interpret the range address from the string you provide.