# How to count cells and blank cells after up until another cell in separate columns

The title is a bit confusing, but essentially I am creating a calendar/tracker where a user inputs values into the "Work" column and the spreadsheet should count those values and blank cells afterward in order to output values into the "Start Day, End Day, Work Length, and Cycle Length" columns. I'm looking for formulas that can calculate each value in those 4 columns. I'd prefer to get this accomplished without macros/scripts.

Start Day corresponds with the first non-blank cell in the column.
End Day corresponds with the last non-blank cell after the Start Day.
Work Length should count from the Start Day to the End Day.
Cycle Length should count from the first non-blank cell in the column all the way until the last blank cell before the next non-blank cell (Start Day) in the next Month.

I'm able to count for some scenarios, but in instances where there are 2 groups of values in the same Month, the my formulas don't work. Specifically:

• In February, the Cycle Length is 23 days, but it should be 24 days.
• In March, the End Day is incorrect.
• This throws off the rest of the information in future months.

• In February, this year is 2022 and is not a leap year. This throws off your calculation for that part. Here's a temporary (maybe good enough for to be permanent) solution for the March thing: `ARRAY_CONSTRAIN(QUERY({OFFSET(R3,0,-3,31,1),OFFSET(R3,0,-2,31,1)},"SELECT * WHERE Col2 IS NOT NULL ORDER BY Col1 DESC",0),1,1)` Aug 26, 2022 at 8:58
• Hi, welcome to WebApps. I have been looking at this question and have a couple of suggestions thatassist in the long run. 1)Cell A1, H1,O1. The content should a date: `1/1/2022`, `2/1/2022`, formatted as "Long Month name". 2) Cell A3 should be `=SEQUENCE(DAY(EOMONTH(A1,0)),1,A1,1)`; formatted as Day number. The formula will populate the column for as many days there are in the month. The formula can be copied to H3, O3 and so on. The important issue here is to use date fields wherever possible - it makes life easier in the long run. Aug 31, 2022 at 0:37