# Count Row values based on Column header

1. ## 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. ## Re: Count Row values based on Column header

Sramakrishna,
Try using the count formula instead of sumif.
Formula:
`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. ## 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. ## Re: Count Row values based on Column header

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

or
Formula:
`Please Login or Register  to view this content.`

5. ## 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. ## Re: Count Row values based on Column header

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

7. ## Re: Count Row values based on Column header

Hi,

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

8. ## Re: Count Row values based on Column header

Perhaps...

=SUMPRODUCT((\$D\$11:\$BB\$11=\$G\$11)*(\$D12:\$BB12<>""))

9. ## Re: Count Row values based on Column header

Hi Fotis,

This works perfect!

Thanks a lot

10. ## Re: Count Row values based on Column header

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

#### Thread Information

##### Users Browsing this Thread

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

#### 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