+ Reply to Thread
Results 1 to 4 of 4

Countif and Variable Date Range

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Countif and Variable Date Range

    I have a time off tracker that has individual days as headers in the columns, e.g., | 1/1/2 | 1/2/12 | 1/3/12 |, etc.

    In the rows, I have employee names, e.g.:
    Jack
    Nancy
    Tom

    Within the cells of the grid, I track different types of days off, like "V" for vacation, "S" for sick, "H" for holidays, etc.

    In a cell at the top of the spreadsheet, I have today's date "=Today()"
    What I would like to do is, for a given employee, count the number of V's between 1/1/12 and today's date in his particular line.

    The MATCH function will certainly tell me how many columns over I have to include in the COUNTIF range, but I can't seem to combine MATCH into the COUNTIF function. Can I do this, or have you other suggestions?

    Thanks...Neil

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Countif and Variable Date Range

    Give a try to COUNTIFS function.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    08-10-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Countif and Variable Date Range

    Sorry, off the mark. It's easy to countif the number of occurrances of "V" within a range of cells in the row starting from B2 through MN2. It is the act of making the MN2 variable that I'm having trouble with. Thanks for the try, though.

    ...Neil
    Last edited by neilfleming; 09-26-2012 at 11:36 AM.

  4. #4
    Registered User
    Join Date
    08-10-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Countif and Variable Date Range

    I think I found it:

    =COUNTIF($B2:*(OFFSET($B2,0,MATCH($A$1,$B$1:$MN$1,0)-1)),"V")

    (Don't worry about the *, it's to stop the software from turning part of the formula into a smiley face.)

    ...Neil
    Last edited by neilfleming; 09-26-2012 at 11:50 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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