ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   INDIRECT COUNTIF's?? (https://www.excelbanter.com/excel-programming/345131-indirect-countifs.html)

alymcmorland[_22_]

INDIRECT COUNTIF's??
 

Can you mix this statement:


VBA:

=COUNTIF( '2005'!B6:B370,"L")

of which counts all the L's that appear from B6 to B370 on tab shee
2005 with this one:


VBA:

=INDIRECT("'"&YEAR(NOW())&"'!B1")

of which finds out what year it is and then points itself to th
correct tab sheet, baring in mind that the tab sheets are named afte
the years so like 2005 2006 2007 etc..

Anyway what i want is like an indirect countif statement, i need th
function of the countif statement but where it says '2005' i need tha
number to be determined by what the year currently is, of which i
where the functionality of the indirect statement comes in, s
depending on what year it is depends on the tab sheet but it needs t
countif still.

Is this possible

--
alymcmorlan
-----------------------------------------------------------------------
alymcmorland's Profile: http://www.excelforum.com/member.php...fo&userid=2765
View this thread: http://www.excelforum.com/showthread.php?threadid=48344


Bob Phillips[_6_]

INDIRECT COUNTIF's??
 
=COUNTIF(INDIRECT("'"&YEAR(TODAY())&"'!B6:B370")," L")


--

HTH

RP
(remove nothere from the email address if mailing direct)


"alymcmorland"
wrote in message
...

Can you mix this statement:


VBA:

=COUNTIF( '2005'!B6:B370,"L")

of which counts all the L's that appear from B6 to B370 on tab sheet
2005 with this one:


VBA:

=INDIRECT("'"&YEAR(NOW())&"'!B1")

of which finds out what year it is and then points itself to the
correct tab sheet, baring in mind that the tab sheets are named after
the years so like 2005 2006 2007 etc..

Anyway what i want is like an indirect countif statement, i need the
function of the countif statement but where it says '2005' i need that
number to be determined by what the year currently is, of which is
where the functionality of the indirect statement comes in, so
depending on what year it is depends on the tab sheet but it needs to
countif still.

Is this possible?


--
alymcmorland
------------------------------------------------------------------------
alymcmorland's Profile:

http://www.excelforum.com/member.php...o&userid=27652
View this thread: http://www.excelforum.com/showthread...hreadid=483449





All times are GMT +1. The time now is 04:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com