Feb 10 2021 07:02 AM
I have 3rows x13 columns with the following data:
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4
1 5 6 7 8
Usually, I use count (A1 to A12), count (B1:B12) and count (c1to C12) into 3 cells and use anothe cell to determine the max among the 3 formula to get 12 evengthough the total column =13. If there another way to do this with a single line of code?
Feb 10 2021 08:00 AM
I may have laid my spreadsheet out differently (in rows), but a single formula is quite easy:
=MAX(COUNT(A4:L4),COUNT(A5:L5),COUNT(A6:L6))
if you wanted to get the largest sum of the three rows, just change COUNT to SUM. Etc.
Changing MAX to MIN would get the smallest.
Feb 10 2021 03:15 PM
@mathetes Assuming the area to count is column A to M. Instead of having to define each row (A4: M4), is it possible to do the same count by area (A4:M6) and the outcome is 12?
Feb 10 2021 03:25 PM
@Chan_Tze_Leong I have close to 40 excel files with varying areas. So, to do each row range , is very tedious and time consuming. Imagine, for 1 file, I have to select 10 times for 10 rows. Alternatively, selecting the area is only 1 time activity.
Feb 10 2021 07:26 PM
I'm sure something is possible there, but nothing is coming immediately to mind. It would have been helpful had you spelled out the full need at the start, by the way.
Anyway, I'll give it some more thought and try to get back to you in a day or two. In the meantime, maybe somebody else will jump in and help us both.
Feb 11 2021 02:30 AM
- select you area
- in Name Box (top left from the grid) type Range and press Enter
- enter the formula in suitable empty cell
=MAX(MMULT(--(Range<>""),TRANSPOSE(COLUMN(Range)/COLUMN(Range))))