Hello you all Excel gurus,

I have an Excel spreadsheet that contains an undefined number of lines (from 1 to x - x being generally less than 200). Each line has a few initial columns with some data (item number, dates, ...) and, starting at column I, an undefined number of columns (from 1 to x - x being generally less than 50) than can be either empty or contain an "x".

In each line I would like to count the number of "x" (this I know how to do with the COUNTIF function). In a different sheet, I would like to count the number of times the count is 1, the number of times the count is 2, and so on until 6.

Problem for me is that the number of lines and columns being changing, I wanted to put all this in a single formula, using arrays but all my tries failed.

My current formula to get the number of lines totaling 1 is:

`{=SUM(IF(SUM(IF(OFFSET(OFFSET($H$2;1;0;TotalLines;1);0;1;1;TotalColumns)="x";1;0))=1;1;0))}`

With `TotalLines` and `TotalColumns` being named ranges containing the result of lines count and column count respectively, so that I have the exact number of lines and columns currently displayed.

Obviously the formula does not work...

Could you please advise on how to proceed,

Thank you in advance for your support