If you promise that on February 29, 2018 you was not go anywhere, then let’s count the cities.
Naming convention: To simplify the formula a bit, let’s assign names to the work ranges, as shown in this picture.
The first step is very simple - to find the offset value from the column days to the desired year.
For last year and this year it will be very similar, differ only by -1:
MATCH(YEAR(TODAY())-1;YearsRow;0)
MATCH(YEAR(TODAY());YearsRow;0)
Finding the string with the current date will be not much more difficult:
MATCH(TEXT(TODAY();"MMM D");DaysColumn;0)
Now you can easily determine the ranges for counting - take the whole column of names of days, move right to the desired year and cut off the excess:
OFFSET(DaysColumn;MATCH(TEXT(TODAY();"MMM D");DaysColumn;0);MATCH(YEAR(TODAY())-1;YearsRow;0);ROWS(DaysColumn);1)
OFFSET(DaysColumn;0;MATCH(YEAR(TODAY());YearsRow;0);MATCH(TEXT(TODAY();"MMM D");DaysColumn;0);1)
Please note: it is assumed that there are no other data below the table of cities. Otherwise, the first formula will be a little more complicated - to limit the height of the OFFSET() range, you need to once again calculate the position of the current date using the MATCH()
Now, using the usual COUNTA(), count the number of non-empty cells in each of the subranges and sum up the values obtained
=COUNTA(
OFFSET(DaysColumn;
MATCH(TEXT(TODAY();"MMM D"); DaysColumn;0);
MATCH(YEAR(TODAY())-1;YearsRow;0);
ROWS(DaysColumn);1))
+ COUNTA(
OFFSET(DaysColumn;
0;
MATCH(YEAR(TODAY());YearsRow;0);
MATCH(TEXT(TODAY();"MMM D");DaysColumn;0);1))
Edit by @SM_Riga on 25.12.2018 19:55 with the permission of @JohnSUN
Please also find Demo spreadsheet with above mentioned functionality and also with how to make formulas easier demonstration, based on the different data structure.