Home » excel » Excel Table: How do I use ONLY the first 30 or 60 rows

Excel Table: How do I use ONLY the first 30 or 60 rows

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have a table in Excel and want to do a CountIf on a column, but only the first 30 or 90. Table is:

DATE, Tag1, Tag2, Tag3, Tag4

I’m looking to do something like:

=COUNTIF(MyTable[Tag4[30]],2)

I know that is not correct since MyTable[Tag4[30]] means nothing and is not a range. I could do it with F2:F31, but since I have to replicate it 4 times (4 Tags), I would rather it be as generic as possible.

Thanks!

How to&Answers:

You can use the OFFSET function to construct the Range

=COUNTIF(OFFSET(MyTable[[#Headers],[Tag4]],1,0,30),2)

Answer:

You can use INDEX():

=COUNTIF(INDEX(MyTable[Tag4],1):INDEX(MyTable[Tag4],30),2)