+ Reply to Thread
Results 1 to 5 of 5

countif value in column based on date match in header

  1. #1
    Registered User
    Join Date
    10-12-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    20

    countif value in column based on date match in header

    Hi,

    Looking for a formula to count all occurrences in a column determined by match function on date in header.

    I have names in column a, row 1 contains dates and row 2 sub headers booked and arrived. I would like to calculate how many y appear in a column based on the column determined by the match on the date in row 1 for booked and arrived and summarised i5 to k7 in a table.

    Can someone please help?

    Many thanks
    Attached Files Attached Files

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,841

    Re: countif value in column based on date match in header

    If you had the dates in both the Booked and Arrived columns (instead of just centered across both columns), you could use this formula in J5 and copy it into J6, J7 and K5:K7:

    =SUMPRODUCT(($B$1:$G$1=$I5)*($B$2:$G$2=J$4)*($B$3:$G$17="y"))

    - Moo

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    50,217

    Re: countif value in column based on date match in header

    Try this, copied down amd across...
    =COUNTIF(OFFSET($B$3,,MATCH(J$4,$B$2:$C$2,0)-1+MATCH($I5,$B$1:$G$1,0)-1,COUNTA($A$3:$A$17),1),"y")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    13,764

    Re: countif value in column based on date match in header

    Using the suggestion in #2, you also can use a pivot table to get the result.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2013
    Posts
    7,686

    Re: countif value in column based on date match in header

    j5=COUNTIF(INDEX($B$3:$G$17,,MATCH($I5,$B$1:$G$1,0)+(J$4<>"Booked")),"Y")
    Please Login or Register  to view this content.
    Trythis and copy across
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

+ 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. Using Lookup? Index match? to populate cells based on column header
    By NoExcelSkills17 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-15-2015, 03:50 PM
  2. Replies: 1
    Last Post: 10-05-2013, 03:35 PM
  3. Merge multiple worksheet to summary worksheet based on column header value match
    By rafiomeon in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-23-2012, 03:37 AM
  4. Finding a column value based on date and column header
    By soready42012 in forum Excel General
    Replies: 0
    Last Post: 01-18-2012, 06:21 PM
  5. Replies: 3
    Last Post: 09-01-2011, 01:47 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