November 28, 2018
The COUNTIF function can be used in many different ways. One such way is to count the number of items bought after a specified date.
Item | Cost |
---|---|
Nails | 1/1/2018 |
Screws | 7/8/2018 |
Glass | 29/5/2017 |
Plastic Sheets | 1/1/2015 |
Wood | 10/10/2018 |
Steel Sheets | 5/2/2018 |
Wood Glue | 9/7/2016 |
Note
Please note the date format is correct for my locale. You can always use the ISO date format to ensure correctness in every locale. I will show you later in this article.
I started my table from cell B2 instead of A1 to make it easier to see.
In cell B11, I wrote the text: “Items bought after 1/7/2016”
Add the following formula
Note
We are using the static (unchanging) value “1/7/2016”. We can also use a cell reference in the COUNTIF function, which I will show you later.
Formula
=COUNTIF(C3:C9,">1/7/2016")
In this alternate step, we are using a cell reference. We are using the value stored in cell E3 to determine the value we are using in our COUNTIF function.
Note
Please take note at the formula below and take note of the ”&” sign *before the E3 cell reference*
Formula
=COUNTIF(C3:C9,">"&E3)
ISO Date description
Formula
=COUNTIF(C3:C9,">2016-07-01")