Ok I'm not a Jedi Master of Excel but I count myself as a reasonable padawan, anyway this is what I'd like to do: I have of course googled but nothing as yet does what I want. OK I have a column the cells of which are either populated or not. I would like to obtain a value for the longest section of contiguously populated cells in that column. eg so Col A reading down has. A,B,C,blank,blank,A,B, blank, A,B,C,D,blank,A - I would like to extract the number 4 from that, ie A,B,C,D is the longest contiguously populated sequence in the column. Any ideas? thanks.
Assuming Column A with 20 Rows =MAX(FREQUENCY(IF(A1:A20"",ROW(A1:A20)),IF(A1:A20="",ROW(A1:A20)))) This is an array formula and must be entered with Control + Shift + Enter, except in Excel 365 which has native control of array formulas . If entered correctly you'll see the formula wrapped in curly braces {} in the formula bar.
Test column A for blank, if it is not add 1 to value of new column, if it is zero new column.
New column will contain 1,2,3,0,0,1,2,0,1,2,3,4,0,1
search new column for largest number = longest number of non-zero cells.
...and just because this text formatting issue has been bugging me here is a re-jigged version of the formula where the EQUAL is NOTted to replicate NOT EQUAL
First of all bhg thanks that's a way of doing it that I had not considered and that would work. However, hats off to ABerrant that is genius, not done much in the way of array functions so I'm grateful to you for that, I got it working in a test sheet but not in my main sheet but that's probably me not typing it correctly. Anyway BA, well earned.
dunno what's happening AB is chopping my post? ah just realised it doesn't like less than greater than signs.
12:27 should read:
Ah penny dropped! the col contains numeric data thus I needed greater than 0 and less than 1 as the 2 tests. Works a treat now!
Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.