Closed Thread
Results 1 to 4 of 4

COUNTIFS Data Range Criterion

  1. #1
    Registered User
    Join Date
    03-21-2023
    Location
    Edinburgh
    MS-Off Ver
    2302
    Posts
    4

    COUNTIFS Data Range Criterion

    Hi everyone!

    I am currently working on a simple table matrix in which I want to count the occurrences that match certain criteria. I have data points for wave height and period and want to create its power matrix, a.k.a. count how many times there is a data entry which has a height between 0.1 and 0.3 [m] AND a corresponding period between 2.0 and 2.5 [s]. I want to do this for a range of height between 0.1 m and 6.5 m (0.2 m increments) and a range of periods between 2.0 s and 21 s (0.5 s increments).

    I was trying to do this using =COUNTIFS through something like this for a case of height between 0.76 and 0.77 and a period between 4 and 5 seconds:

    =COUNTIFS($N$47:$N$63;(AND(">=0.76";"<0.77"));$O$47:$O$63;(AND(">=4";"<5")))

    But it always gives 0 as a result. Ideally, I wouldn't have to type in the range restriction values each time but just refer to the cells that are defined in the table. Here is the link to the file (with a " " between .com), and below the main table is my 'playground' for trying to figure it out on a much smaller database.

    uoe-my.sharepoint .com/:x:/g/personal/s1969090_ed_ac_uk/ESA8mk1gwpxNnXR7buAM7VwBJXI4OW1QWYOEuUY3V9PnFA?e=Zwfb2o

    All the help would be very much appreciated!
    Last edited by Glenn Kennedy; 04-05-2023 at 03:09 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,158

    Re: COUNTIFS Data Range Criterion

    The correct syntax is:

    =COUNTIFS($B:$B,">="&$G7,$B:$B,"<"&$G7+0.2,$C:$C,">="&H$6,$C:$C,"<"&H$6+0.5)

    copied across and down.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    03-21-2023
    Location
    Edinburgh
    MS-Off Ver
    2302
    Posts
    4

    Re: COUNTIFS Data Range Criterion

    Fantastic Glenn! Thank you very much!

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,158

    Re: COUNTIFS Data Range Criterion

    This is a public forum. It is there to help all comers. Deleting your own post after you received a satisfactory reply is a little mean-spirited.

    I have restored it.

    Please do not do that again.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. COUNTIFS between two dates with extra criterion match
    By Newtonus_Prime in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-26-2020, 11:49 PM
  2. Replies: 6
    Last Post: 08-08-2019, 02:41 PM
  3. Cannot CountIfs for Workday Criterion?!?!
    By soccermunkee03 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-05-2019, 12:12 AM
  4. COUNTIFs: Multiple ranges, single criterion with OR logic
    By A.Khan in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-20-2017, 06:05 AM
  5. Find value based on item number (first criterion) and date (second criterion)
    By ivan.stajin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-19-2014, 10:47 AM
  6. [SOLVED] Countifs with Multiple Criterion
    By JohnDear in forum Excel General
    Replies: 7
    Last Post: 05-28-2012, 03:56 PM
  7. COUNTIFS using year as one criterion
    By Sonnydl in forum Excel General
    Replies: 1
    Last Post: 11-11-2011, 02:58 PM

Tags for this Thread

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