Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
"Tom Ogilvy" wrote...
the OP said: This needs to be done using a single formula or array formula, without using a separate running total column using =MAX, and without using a UDF. .... . . . however, this person said they were evaluating a "this can't be done in a single formula" challenge. Not sure why he posted in programming instead of the more logical Worksheet.Functions Indeed, so I'm crossposting to worksheet.functions. Follow-up there. Of course it can be done in a single array formula - just barely. If the data were in a single column by multiple row range named rec, then try the following. =COUNT(OFFSET(rec,MATCH(MAX( MMULT(--(ROW(rec)=TRANSPOSE(ROW(rec))) -(MMULT(--(ROW(rec)=TRANSPOSE(ROW(rec))), --((rec<0)*ROW(rec)=TRANSPOSE(ROW(rec))))0),1-(rec<0))), MMULT(--(ROW(rec)=TRANSPOSE(ROW(rec))) -(MMULT(--(ROW(rec)=TRANSPOSE(ROW(rec))), --((rec<0)*ROW(rec)=TRANSPOSE(ROW(rec))))0),1-(rec<0)),0) -MAX(MMULT(--(ROW(rec)=TRANSPOSE(ROW(rec))) -(MMULT(--(ROW(rec)=TRANSPOSE(ROW(rec))), --((rec<0)*ROW(rec)=TRANSPOSE(ROW(rec))))0),1-(rec<0))),0, MAX(MMULT(--(ROW(rec)=TRANSPOSE(ROW(rec))) -(MMULT(--(ROW(rec)=TRANSPOSE(ROW(rec))), --((rec<0)*ROW(rec)=TRANSPOSE(ROW(rec))))0),1-(rec<0))),1)) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
finding maximum, minimum in a range consists both Positive and Negative numbers | Excel Worksheet Functions | |||
count current run of positive numbers | New Users to Excel | |||
Count cells with positive numbers | Excel Discussion (Misc queries) | |||
how to add consecutive positive numbers | Excel Discussion (Misc queries) | |||
Count Consecutive Numbers in a Row | Excel Worksheet Functions |