Forum Discussion
Countifs Based on Different Criteria Troubles
Need some help please! Trying to count data points based on two different sets of criteria and struggling.
Example: I need to count the total of Types that equal "Best" and where the End Date is within 30 days from today (note: I need to use "Today()" in formula or equivalent). I was able to write the formula for one cell, but when I try to rewrite it to encompass a range of cells, it won't work.
So....count # of records where A2:A4="Best" and where the End Date is less than or equal to 30 days from current day (B2:B4-Today()<=30).
Based on the example data below, the formula should return 2. Only two line items match both sets of criteria based on Today() being 10-13-22. Appreciate the help!!! Thanks
Type (ColA) | End Date (ColB) |
Best | 12-5-22 |
Worst | 10-1-22 |
Best | 11-2-22 |
Best | 10-31-22 |
- OliverScheurichGold Contributor
- nnflstpCopper ContributorThank you thank you!!
In your example, the ranges would be A2:A5 and B2:B5.
=COUNTIFS(A2:A5,"Best",B2:B5,"<="&TODAY()+30)
- nnflstpCopper ContributorThanks as well Hans. Totally was approaching the within 30 days calculation incorrectly.