+ Reply to Thread
Results 1 to 5 of 5

Countifs / hlookup based on conditions

Hybrid View

  1. #1
    Registered User
    Join Date
    09-16-2023
    Location
    Perth
    MS-Off Ver
    Office 365
    Posts
    2

    Countifs / hlookup based on conditions

    Hi,

    I need some assistance with formulas to determine the Week Ending & Following Week Statistics. I need each of the column D personnel to count the cells if the cell contains either 12, FIA or FOP, for the date range provided in Cell D3.
    I have manually entered some of the numbers which should appear in Columns D & E.

    Your assistance would be greatly appreciated
    Attached Files Attached Files
    Last edited by AliGW; 09-17-2023 at 02:00 AM. Reason: SOLVED tag applied - no need to edit the thread title!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,605

    Re: Countifs / hlookup based on conditions

    Welcome to the forum.

    Cell D3 does not contain a date RANGE, rather a single date, so how do you want it interpreting? Is it the week start date?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,605

    Re: Countifs / hlookup based on conditions

    OK. Try:

    =COUNTA(FILTER(O5:AB5,($O$4:$AB$4>D$3-7)*($O$4:$AB$4<=D$3)*((O5:AB5=12)+(O5:AB5="FIA")+(O5:AB5="FOP"))))

    =COUNTA(FILTER(O5:AB5,($O$4:$AB$4>=D$3)*($O$4:$AB$4<D$3+7)*((O5:AB5=12)+(O5:AB5="FIA")+(O5:AB5="FOP"))))
    Attached Files Attached Files
    Last edited by AliGW; 09-16-2023 at 04:40 AM. Reason: Workbook added.

  4. #4
    Registered User
    Join Date
    09-16-2023
    Location
    Perth
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Countifs / hlookup based on conditions

    Thank you for your reply.
    This works well, except for in any rows where there is no information in column O:AB this pastes 1, instead of 0 (see the yellow highlighted cells). Any idea on how to fix?

    Attachment 842917

  5. #5
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Countifs / hlookup based on conditions

    Please replace COUNTA with COUNT (COUNTA counts also #VALUE if the FILTER function returns #VALUE)

    or

    replace COUNTA(FILTER(O5:AB5, with SUM( and remove 1 bracket at the end of the formula.

+ 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. VLookup / Hlookup / Match Index with Countifs
    By Jason Munro in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-01-2022, 11:35 AM
  2. [SOLVED] Trouble with Countifs / Hlookup formula
    By Travisty in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-08-2021, 05:01 AM
  3. Countifs with conditions based on same row in source
    By ritmo2k in forum Excel General
    Replies: 3
    Last Post: 08-10-2019, 10:47 PM
  4. Countifs with HLookup
    By loneill0510 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-08-2018, 06:23 PM
  5. Countifs - Counting based on conditions
    By Excel-Erick in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-15-2016, 11:26 AM
  6. [SOLVED] HLOOKUP plus COUNTIFS?
    By Minoli in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-27-2015, 03:59 PM
  7. Replies: 0
    Last Post: 12-16-2011, 09:01 AM

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