Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Countif only col a = col b by date

I am trying to count the number of times both col a and col b have a 1 in
them on the same day. The spreadsheet has three columns A=Date C=1 or
blank,D=1or blank. The formula I have is this
=COUNTIF(C1:C367,"1")-COUNTIF(D1:D367,"1") but it is not giving me the
correct count number of times that column c and col d are equal. Any
suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Countif only col a = col b by date

try
=sumproduct(--(c1:c367=d1:d367))
the"--(" makes the logical true false be a numeric 1 0


"RichardM" wrote:

I am trying to count the number of times both col a and col b have a 1 in
them on the same day. The spreadsheet has three columns A=Date C=1 or
blank,D=1or blank. The formula I have is this
=COUNTIF(C1:C367,"1")-COUNTIF(D1:D367,"1") but it is not giving me the
correct count number of times that column c and col d are equal. Any
suggestions?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Countif only col a = col b by date

=SUMPRODUCT(--(A1:A100=--"3/17/2007"),--(C1:C100=1),--(D1:D100=1))

Adjust to suit


"RichardM" wrote:

I am trying to count the number of times both col a and col b have a 1 in
them on the same day. The spreadsheet has three columns A=Date C=1 or
blank,D=1or blank. The formula I have is this
=COUNTIF(C1:C367,"1")-COUNTIF(D1:D367,"1") but it is not giving me the
correct count number of times that column c and col d are equal. Any
suggestions?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Countif only col a = col b by date

Thank you for the formula, however I think I haven't explained the question
right. There are 364 days in the year. I am trying to count how many times
col c equals col d. Is it 2 or 6 or 360?

"bj" wrote:

try
=sumproduct(--(c1:c367=d1:d367))
the"--(" makes the logical true false be a numeric 1 0


"RichardM" wrote:

I am trying to count the number of times both col a and col b have a 1 in
them on the same day. The spreadsheet has three columns A=Date C=1 or
blank,D=1or blank. The formula I have is this
=COUNTIF(C1:C367,"1")-COUNTIF(D1:D367,"1") but it is not giving me the
correct count number of times that column c and col d are equal. Any
suggestions?

  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Countif only col a = col b by date

I misread your question, try
=sumproduct(--(c1:c367=1),--(d1:d367=1))

"RichardM" wrote:

Thank you for the formula, however I think I haven't explained the question
right. There are 364 days in the year. I am trying to count how many times
col c equals col d. Is it 2 or 6 or 360?

"bj" wrote:

try
=sumproduct(--(c1:c367=d1:d367))
the"--(" makes the logical true false be a numeric 1 0


"RichardM" wrote:

I am trying to count the number of times both col a and col b have a 1 in
them on the same day. The spreadsheet has three columns A=Date C=1 or
blank,D=1or blank. The formula I have is this
=COUNTIF(C1:C367,"1")-COUNTIF(D1:D367,"1") but it is not giving me the
correct count number of times that column c and col d are equal. Any
suggestions?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
countif and date formats shnim1 Excel Discussion (Misc queries) 1 November 10th 06 02:30 AM
CountIf by Month-to-date ashley0578 Excel Worksheet Functions 8 April 19th 06 04:22 PM
countif date ferde Excel Worksheet Functions 2 March 12th 06 09:13 PM
CountIf on Date field sarjak Excel Worksheet Functions 3 March 2nd 06 07:55 PM
Using Countif for Date Matches Raymond Gallegos Excel Worksheet Functions 13 December 30th 04 02:07 AM


All times are GMT +1. The time now is 03:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"