+ Reply to Thread
Results 1 to 6 of 6

What to Use Instead of Count If on Multiple Worksheets

  1. #1
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    What to Use Instead of Count If on Multiple Worksheets

    I am trying to obtain a total from Cell A1 on twelve annual worksheets named January - December providing the cell is less than 4.

    I know that I can do this: COUNTIF('January'!A1,"<4")+COUNTIF('February'!A1,"<4")+ etc....

    Is there a better way? I have read that there isn't a VBA equivalent to COUNTIF

    I can add an example sheet if necessary.

  2. #2
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    1,992

    Re: What to Use Instead of Count If on Multiple Worksheets

    An easy sample file to add A1 of 1-4th months. You can modify according to your needs.

    C2:C5
    January
    February
    March
    April

    D1
    =SUMPRODUCT(COUNTIF(INDIRECT("'"&C2:C5&"'!A1"),"<4"))
    Attached Files Attached Files

  3. #3
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    200

    Re: What to Use Instead of Count If on Multiple Worksheets

    Hi Manchester Gunners!

    If your values are integers, you could use:
    PHP Code: 
    =INDEX(FREQUENCY('January:December'!A1,3),1
    If have decimals, just add a number of decimals after the 3:
    PHP Code: 
    =INDEX(FREQUENCY('January:December'!A1,3.999),1
    Blessings!

  4. #4
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    Re: What to Use Instead of Count If on Multiple Worksheets

    Quote Originally Posted by John Vergara View Post
    Hi Manchester Gunners!

    If your values are integers, you could use:
    PHP Code: 
    =INDEX(FREQUENCY('January:December'!A1,3),1
    If have decimals, just add a number of decimals after the 3:
    PHP Code: 
    =INDEX(FREQUENCY('January:December'!A1,3.999),1
    Blessings!
    I'm sorry but I don't understand PHP. I use it on my web pages but have never seen it with excel. Do I just copy and paste it onto the VBA page?

  5. #5
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    Re: What to Use Instead of Count If on Multiple Worksheets

    Quote Originally Posted by windknife View Post
    An easy sample file to add A1 of 1-4th months. You can modify according to your needs.

    C2:C5
    January
    February
    March
    April

    D1
    =SUMPRODUCT(COUNTIF(INDIRECT("'"&C2:C5&"'!A1"),"<4"))
    That seems fine. I guess I just add teh remaining months and change C5 to C13

  6. #6
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    200

    Re: What to Use Instead of Count If on Multiple Worksheets

    Hi again Manchester...

    the PHP is just a code tag. Is a normal Excel formula that you can copy to your worksheet. I like the PHP style for the colors instead of another tags. Blessings!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Trying to sum count from multiple worksheets
    By Jo Ross in forum Excel General
    Replies: 5
    Last Post: 08-08-2016, 03:45 AM
  2. Count Worksheets in multiple files
    By dwb11 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-09-2015, 07:18 PM
  3. Sum multiple worksheets and summary tab that would sum and count by rep name.
    By angie.chang in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-15-2013, 12:50 PM
  4. count unique values in multiple worksheets with multiple criteria
    By craig04 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-06-2012, 03:26 PM
  5. Replies: 12
    Last Post: 01-18-2012, 02:51 PM
  6. Count/IF formula between multiple Worksheets
    By shotgunpet in forum Excel General
    Replies: 5
    Last Post: 04-10-2011, 03:41 PM
  7. Replies: 0
    Last Post: 02-26-2010, 02:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1