COUNTIF?

  • Thread starter Thread starter Bill Oertell
  • Start date Start date
B

Bill Oertell

I sure hope someone can help. I need a function like COUNTIF except that I want
it to find the range to count based on the row and column headings it's used in
rather than having to state it explicitly. The row would be the sheet to look
at and the column heading would be the column to match in that sheet. So, if
the row heading was "3456" and the column heading was "ABC", then the function
would look at sheet "3456" and count the number of matching things in the column
with the heading "ABC". This would be used in a sheet separate from the sheets
the function needs to look at but part of the same workbook. And to throw a
wrench in the whole mess, the column headings may not be in row 1. The column
headings might be in some other row...say 5 or 6.
Any help would be greatly appreciated. Many thanks!
 
Hi

I read your original message over, and I see I missed that you don't refer
to column (A or AB or...) but for column header. It complicates the matter a
bit.

Try this (with sheet name stored in A1, the column heading in A2 and row
number of header in A3 on sheet with SUMIF formula)
=COUNTIF(OFFSET(INDIRECT("'"&$A$1&"'!$A$1");$A$3-1,MATCH($A$2,INDIRECT("'"&$
A$1&"'!"&$A$3&":"&$A$3),0)-1,65536-$A$3,1),">0")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top