Countifs

trebor1956

Board Regular
Joined
Jul 2, 2015
Messages
100
Office Version
  1. 2013
Platform
  1. Windows
I am trying to count the number of times "H" appears in a row if the date is less than or equal to today.
todays date is in cell A1, the row of dates are between R4:JR4, the letter "H" if present is in cells R4:JR4. The formula I use is
=COUNTIFS($R$4:$JR$4,"<="&$A$1,$R$4:$JR$4,"H")
I have just noticed that if there is an "H" under the date for today then this isn't added but an "H" in all dates prior to today are added. Any idea why this is?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi, do you also have times in R4:JR4?

If so - you could try..

=COUNTIFS($R$4:$JR$4,"<"&$A$1+1,$R$4:$JR$4,"H")
 
Upvote 0
Hi, do you also have times in R4:JR4?

If so - you could try..

=COUNTIFS($R$4:$JR$4,"<"&$A$1+1,$R$4:$JR$4,"H")
Hi,

No times just the date. My own logic would suggest if the date in R4:JR4 is either today or before today and has an "H" it should be counted, but it doesn't seem to be. I can't understand it.
 
Upvote 0
OK - hang on, just noticed that your checking the same cells for the date and the letter H.

Perhaps you can post some example data and expected results as I can't see how the formula works at all, even for dates prior to today?
 
Upvote 0
OK - hang on, just noticed that your checking the same cells for the date and the letter H.

Perhaps you can post some example data and expected results as I can't see how the formula works at all, even for dates prior to today?

OK - hang on, just noticed that your checking the same cells for the date and the letter H.

Perhaps you can post some example data and expected results as I can't see how the formula works at all, even for dates prior to today?
=COUNTIFS($J
OK - hang on, just noticed that your checking the same cells for the date and the letter H.

Perhaps you can post some example data and expected results as I can't see how the formula works at all, even for dates prior to today?
I think I made in a mistake in the first question I posted. The formula below is what is there, the dates are in row 2 the letter "H" if present is in row 4.
=COUNTIFS($R$2:$JR$2,"<="&$A$1,$R$4:$JR$4,"H")
 
Upvote 0
OK let's do some trouble shooting then..

What do these return when placed in a spare cell..?
1.
Excel Formula:
=A1=TODAY()
2.
Excel Formula:
=R2=TODAY()
- change R2 to a cell that you believe contains today's date and has a H in row 4
3.
Excel Formula:
=R4="H"
- change to the cell to reference the same column as 2
 
Upvote 0
OK let's do some trouble shooting then..

What do these return when placed in a spare cell..?
1.
Excel Formula:
=A1=TODAY()
2.
Excel Formula:
=R2=TODAY()
- change R2 to a cell that you believe contains today's date and has a H in row 4
3.
Excel Formula:
=R4="H"
- change to the cell to reference the same column as 2
1. says todays date
2. says TRUE
3. I'm not sure what you want me to do for 3
 
Upvote 0
Massive apologies to all those who are trying to help me. I have just spotted where I have been going wrong. All sorted, thank you for trying to help.
 
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,846
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top