COUNTIFS / Inventory Specialist

Count Expiring Batches

I need to count how many batches have an 'Expiry Date' within the next 30 days.

formula.xlsx
=COUNTIFS(C2:C7, ">="&TODAY(), C2:C7, "<="&TODAY()+30)

How it works: This COUNTIFS formula uses two criteria to define a date range. The `TODAY()` function dynamically retrieves the current date. The first criterion, `">="&TODAY()`, counts items with an expiry date on or after today. The second criterion, `"<="&TODAY()+30`, counts items with an expiry date on or before 30 days from today. By combining these, COUNTIFS accurately tallies only those batches whose expiry dates fall within the specified 30-day window, starting from today.

Data Setup

Batch ID Product Expiry Date Quantity
B001 Milk 2023-10-25 100
B002 Yogurt 2023-11-15 50
B003 Cheese 2023-12-01 75
B004 Butter 2023-10-01 200
B005 Cream 2023-11-05 120
B006 Juice 2023-12-20 90

Step-by-Step Guide

1

Identify the column containing your 'Expiry Date' data (e.g., Column C).

2

Determine the range of cells for your expiry dates (e.g., C2:C7).

3

The first criterion checks for dates greater than or equal to today's date: `">="&TODAY()`.

4

The second criterion checks for dates less than or equal to today's date plus 30 days: `"<="&TODAY()+30`.

5

Combine these into the COUNTIFS function: `=COUNTIFS(C2:C7, ">="&TODAY(), C2:C7, "<="&TODAY()+30)`.

6

Enter this formula into any empty cell to get the count of batches expiring within the next 30 days.

Explore More