Consulting

Results 1 to 7 of 7

Thread: countif and hlookup

  1. #1
    VBAX Regular
    Joined
    Jan 2016
    Posts
    13
    Location

    countif and hlookup

    Hi. Need to countif how many instances of "1 Wk Vac FT" from column J34 to column NP34 where if date in row 27 of same columns is less than C34(anniversary date). I am unable to find solution on a index match or hlookup in this case. All help appreciated.

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Not sure if this is what you're after; (adjust date as required)
    =IF(C34<TODAY(),COUNTIF(J34:NP34,"1 Wk Vac FT"),0)
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Regular
    Joined
    Jan 2016
    Posts
    13
    Location
    Hi, to explain further. I need to count instances of "1 Wk Vac FT" from J34 to NP34 where in row J27 which holds dates June 26th in J27, June 28th in K27 etc.. where it counts instances up to the date in C34 (eg Nov 22 2017). So it references the dates in row 27 until it finds the date in C34 then stops counting.

    Hope this explains further.

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Can you post a sample workbook?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    VBAX Regular
    Joined
    Jan 2016
    Posts
    13
    Location
    I uploaded an eg. In cell D4 is my countif formula that I need to adjust counting only instances of "1 Wk Vac FT" etc.. as long as the dates in J1 to NP1 are less than the anniversary date in C4.

    Hope this helps.
    Attached Files Attached Files

  6. #6
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    =COUNTIFS(J$4:NP$4,"1 Wk Vac FT",$J$1:$NP$1,"<"&C4)
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #7
    VBAX Regular
    Joined
    Jan 2016
    Posts
    13
    Location
    That did it! TY

Posting Permissions

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