Reputation: 1
I'm trying to calculate the number of consecutive available days I can schedule my drivers. The schedule I've included shows a date range of 12 days, starting with the day prior. I've tried everything I know but haven't had any luck. For analysis purposes I've boxed and highlighted the "available days" and included a column titled "desired results". The total driver counts are in the hundreds and the future available days are interrupted by other activity on a driver's schedule. My need is to count the blank slots that start today and end with the first populated cell on that driver's schedule (by row).
Upvotes: 0
Views: 171
Reputation: 7735
As far as I can understand, you want to count the number of blank cells beginning in column B until the next populated cell in each row, the following formula will help you achieve your desired results:
=IFERROR(IF(AND(MATCH(TRUE,INDEX(B2:L2="",0),0)=1,MATCH(FALSE,INDEX(B2:L2="",0),0)<>1),MATCH(FALSE,INDEX(B2:L2="",0),0)-1,0),0)
In essence the formula will check if the first Cell in the range (ie. Column B) is blank, then it will check for the first non blank cell in the row, and then give you the results, all this is wrapped in an IFERROR to convert errors to 0.
Upvotes: 1
Reputation: 11978
So it looks like you want to count how many empty cells are in each row, columns B:L, until first non empty cell is found:
My formula in M2 is:
=MATCH("*";B2:L2;0)-1
Drag it down and hope you can adapt it to your needs.
Upvotes: 0