Solved Countifs formula using weekday function

January 4, 2019 at 08:10:50
Specs: Windows 7
I have this formula that I am using for conditional formatting that highlights cells based on the date in column AG. I got the formula from a stackoverflow genius :-) Logic: If Today() is a Monday I need to highlight the cell if the date in AG is the PREVIOUS Friday, Saturday and Sunday If Today() is a Tuesday through Friday then I need to highlight if the date in AG is the previous day

The formula works great in the conditional formatting cells but I also would like to adapt it to a countifs formula so I can count the amount of records that meet the criteria.

=OR(AND(WEEKDAY(TODAY())>= 3,WEEKDAY(TODAY())<=6,INT(AG10)=INT(TODAY()-1)),AND(WEEKDAY(TODAY())=2,INT(AG10)>=INT(TODAY()-3),INT(AG10)<=INT(TODAY()-1)))

Can someone help me tweak it to work with countif or countifs?


See More: Countifs formula using weekday function

Reply ↓  Report •

#1
January 4, 2019 at 08:50:30
✔ Best Answer
Received this formula from Stackoverflow:
=IF(AND(WEEKDAY(TODAY())>= 3,WEEKDAY(TODAY())<=6),COUNTIF(AG:AG,TODAY()-1),IF(WEEKDAY(TODAY())=2,COUNTIFS(AG:AG,">=" & TODAY() -3,AG:AG,"<="&TODAY()-1),0))


Reply ↓  Report •
Related Solutions


Ask Question