Search code examples
excelexcel-formuladatediffcountif

SUMIF and DATEDIF by row


I have a row of dates, with one date per column. Dates are in order from oldest to newest. I am trying to count only those where the difference is 14 days or greater. I need it to count by row

Date A | Date B | Date C | Date D | 2

So Date B - Date A = 13| Date C - Date B = 29| Date D - Date C = 15| 2

The formula should return 2, since the first was less than 14 days. I've spend hours on various forums with no luck. I never post since I am usually able to figure my problems out by reading other's kind posts & suggestion. I appreciate whatever help comes my way.


Solution

  • You can do it with SUMPRODUCT:

    =SUMPRODUCT(--(B1:D1-A1:C1>=14))
    

    Note the offset but same size ranges.

    enter image description here