Forum Discussion

Ayman Abid's avatar
Ayman Abid
Copper Contributor
Jun 02, 2018
Solved

Formula to count cells with conditional formatting

Hi there,   I created a calendar in excel where periods of dates are highlighted with a formula in conditional formatting. Are we able to count the dates highlighted using say a countif or sumif fo...
  • SergeiBaklan's avatar
    Jun 02, 2018

    I'd suggest to simplify a bit condutional formatting rule and use formula for it like

    =COUNTIFS($AA$6:$AA$277,"<="&B7,$AB$6:$AB$277,">="&B7)

    To count the nubmer of highlighted days

    =SUMPRODUCT(($AB$6:$AB$277-$AA$6:$AA$277+1)*ISBLANK($AB$6:$AB$277)*ISBLANK($AA$6:$AA$277))

    Please see attached

Resources