Hello, I have the following data on a sheet:
I need to count the items that are expiring in 1 month or less. The answer should be 3 and I try countif with datedif, but it's not working. Being a super beginner, the formula i used was =COUNTIF(B2:B8,DATEDIF(TODAY(),B2:B8,"M")<1), but it spills and outputs 0 all the way down. If I put the operator @ like so: =COUNTIF(B2:B8,DATEDIF(TODAY(),@B2:B8,"M")<1), it doesn't spill but just outputs 0.
Any help will be very very appreciated.
Thank you!
Book2 | ||||
---|---|---|---|---|
A | B | |||
1 | Items | Expiry | ||
2 | Item 1 | 11/24/2023 | ||
3 | Item 2 | 01/02/2024 | ||
4 | Item 3 | 02/01/2024 | ||
5 | Item 4 | 11/01/2023 | ||
6 | Item 5 | 10/29/2023 | ||
7 | Item 6 | 12/25/2023 | ||
8 | Item 7 | 07/25/2023 | ||
9 | ||||
10 | # expiring in <1 month: | |||
Sheet1 |
I need to count the items that are expiring in 1 month or less. The answer should be 3 and I try countif with datedif, but it's not working. Being a super beginner, the formula i used was =COUNTIF(B2:B8,DATEDIF(TODAY(),B2:B8,"M")<1), but it spills and outputs 0 all the way down. If I put the operator @ like so: =COUNTIF(B2:B8,DATEDIF(TODAY(),@B2:B8,"M")<1), it doesn't spill but just outputs 0.
Any help will be very very appreciated.
Thank you!