View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Counting Unique Empty Cells of a Range

Your first problem is that Excel only has 256 columns, so it won't support
365/6 days.

anyway,
SUM(1*((LARGE(IF((D8:L8="")*(E8:M8<D8:L8),COLUMN( D8:L8),0),{1,2,3,4,5,6,7,8
,9})-LARGE(IF((E8:M8="")*(E8:M8<D8:L8),COLUMN(E8:M8),1 ),{1,2,3,4,5,6,7,8,9}
)+1)=2))

entered with Ctrl+Shift+Enter should indicate the number of 2 successive
blanks in the range D8:M8. I think you have to have a non empty cell at
each end so you might need to put in a dummy column at each end and fill it
with a value.

the arrays 1,2,3,4,5,6,7,8,9 must be numbered high enough to cover the total
number of blank ranges in the row.

D8:M8 was just a testing range. You can adjust if for a larger section of a
row by using a similar pattern.

--
Regards,
Tom Ogilvy

"IronDogg" wrote in
message ...

Tom Ogilvy Wrote:
It isn't clear to me how you got your counts based on the picture you
referenced. So you would have to explain that. Atre cells counted
more
than once and gray cells excluded?

do you want to do this with a macro or with worksheet formulas

Do you want counts by row or a sum over all rows.

--
Regards,
Tom Ogilvy


Okay, the picture shows a work shift schedule, with a Sunday through
Saturday work week. The gray cells are Saturday, Sunday. D=Days,
N=Nights, M=mornings. Cells with nothing in them are days off. What I
am looking for is a formula at the end of each row that will calculate
how many "2 Day off"-sets of days off there were in an entire years
shift. Then another cell with a formula showing how many "3 Days
off"-sets of days off there were in an entire years shift, then 4 days,
then 5 days, then any sets larger than 5 days... Gray cells are included
in counts. Does that help explain my problem better?


--
IronDogg
------------------------------------------------------------------------
IronDogg's Profile:

http://www.excelforum.com/member.php...o&userid=33291
View this thread: http://www.excelforum.com/showthread...hreadid=531171