View Single Post
  #12   Report Post  
Chris
 
Posts: n/a
Default

Here you go
=IF(SUMPRODUCT(--(COUNTIF(INDIRECT("'"&WSlst&"'!K5:K20"),Q5)0)),IN DEX(WSlst,MATCH(TRUE,COUNTIF(INDIRECT("'"&WSlst&"' !K5:K20"),Q5)0,0)),"Not Found")



"Harlan Grove" wrote:

"Chris" wrote...
looking at the formula it appears to search and find the ref number in
January (which is true) but returns the #N/A rather than the worksheet name
from the WSLst named range


Show the *EXACT* formula you're using. I tested the original I proposed,

=IF(SUMPRODUCT(--(COUNTIF(INDIRECT("'"&WSLst&"'!K5:K20"),Q5)0)),
INDEX(WSLst,MATCH(TRUE,COUNTIF(INDIRECT("'"&WSLst& "'!K5:K20"),Q5)0,0)),
"Not found")

and it works, i.e., it never returns #N/A unless there's an #N/A in WSLst
itself. That is, if WSLst referred to SomeWorksheet!A1:A12, and that range
contained Jan, Feb, ..., Dec, respectively in each cell, and each of these
cells contained the name of another worksheet in the same workbook, there's
no way it could return #N/A.