+ Reply to Thread
Results 1 to 10 of 10

Count Row values based on Column header

  1. #1
    Registered User
    Join Date
    05-16-2013
    Location
    India,Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Count Row values based on Column header

    I have data in the below format
    Name AccruedDate UtilisedDate Lapsed Date AccruedDate UtilisedDate Lapsed Date
    Anna 3rd Feb 2013 10th Mar 2013 3rd Apr 2013 3rd Feb 2013 3rd Apr 2013 3rd Apr 2013
    Mary 4th Jan 2013 4th Apr 2013 5th June 2013 15th June 2013

    I want the count of how many Anna and Mary has Acrrued Leaves (answer is 2) which is under "Accrued Date" column and the same way I want count of how many Utillised Leaves and how many Lapsed Leaves for all the employees under the "UtilisedDate" and "Lapsed Date" column respectively. Also note that some of these columns can also be left blank if there are no dates to be entered.

    Sumif(A1:A7,"Accrued Date",B2:B7) will give the sum of all the dates which is the wrong answer since I want the count. Please help.

    Thanks in advance

  2. #2
    Registered User
    Join Date
    06-01-2013
    Location
    Columbus, ms
    MS-Off Ver
    Excel 2013
    Posts
    68

    Re: Count Row values based on Column header

    Sramakrishna,
    Try using the count formula instead of sumif.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If that doesn't work please attach a workbook example so we can see which dates line up in which column. Attaching a workbook is the forum guideline's preferred method of inputting data.

  3. #3
    Registered User
    Join Date
    05-16-2013
    Location
    India,Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Count Row values based on Column header

    Hi Spitzerpl,

    I have tried

    1. = count (a1:a7) - It will give count of all the cells but I want only the Accured Dates
    2. = Count (b1,e1) - This will work. But I am having 100 columns and I cannot use more than 30 cell references in the count formula.

  4. #4
    Registered User
    Join Date
    06-01-2013
    Location
    Columbus, ms
    MS-Off Ver
    Excel 2013
    Posts
    68

    Re: Count Row values based on Column header

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    or
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-16-2013
    Location
    India,Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Count Row values based on Column header

    =Countif(a1:a7,">1") is giving the count of all the values (Accrued Date,Utilised Date & Lapsed Date). In this example it is giving 4. But the answer is 2.

    I want the count of all the values under the column "Accrued Date" for a particular employee

  6. #6
    Registered User
    Join Date
    06-01-2013
    Location
    Columbus, ms
    MS-Off Ver
    Excel 2013
    Posts
    68

    Re: Count Row values based on Column header

    I will need to see your data in an excel sheet.

  7. #7
    Registered User
    Join Date
    05-16-2013
    Location
    India,Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Count Row values based on Column header

    Hi,

    This is the sample and I would have more than 100 columns like this repeated.
    Attached Files Attached Files

  8. #8
    Forum Moderator 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: Count Row values based on Column header

    Perhaps...

    =SUMPRODUCT(($D$11:$BB$11=$G$11)*($D12:$BB12<>""))
    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.

  9. #9
    Registered User
    Join Date
    05-16-2013
    Location
    India,Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Count Row values based on Column header

    Hi Fotis,

    This works perfect!

    Thanks a lot

  10. #10
    Forum Moderator 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: Count Row values based on Column header

    ......................

+ 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