COUNTIF to act like COUNTUNTIL

  • Thread starter Thread starter RabidDawg
  • Start date Start date
R

RabidDawg

Is there anyway to acheive this functionality?

I have a list of times (in ten hour increments):
TIME
7:00
17:00
3:00

I am trying to get a COUNTIF formula to count the number of rows
(based on the hour component of the time and without any additional
column usage, etc.) until it reaches a row whose hour component is
less than the previous row's hour component.

In this instance, the COUNTIF should return 1

Is this possible?
 
Hi
if your data stafrts in A2 (A1 is a heading) use
=SUMPRODUCT(--(A3:A100<A2:A99),--(A3:A100<>""))
 
Assuming your Time column is column A with title on row 1 and data starts on row 2. Insert a column, say, column B, add the following formula:

In [B2] enter: 1
In [B3] enter: "=IF(A3>A2,1*B2,0)"

Copy [B3] and paste all the way down to the bottom of your list. Then do a sum on column B from [B2] to the end of the list. This should do the trick.
 
Back
Top