Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8259537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:53:18+00:00 2026-06-08T02:53:18+00:00

In a range where different columns may have different numbers of values (but there

  • 0

In a range where different columns may have different numbers of values (but there won’t be gaps in the sequence within a column) I’d like to know the length of the longest column. To be more demanding, I’d like it in a single formula.

So given a range like this:

      |  A   B   C   D
   ---+---+---+---+---
    1 |  1   2   3   4
    2 |  2   9   5   6
    3 |      5   5
    4 |          4
    5 |

.. the answer I want is 4.

Something that works in this case is

=MAX(COUNT(A1:A999),COUNT(B1:B999),COUNT(C1:C999),Count(D1:D999))

But it’s (a) ugly and (b) inflexible – doesn’t cater for the case where a column might be added.

I tried something like this, hoping for an array giving the set of column counts (hoping to wrap a MAX() around it):

{=COUNT(OFFSET(A1,0,COLUMN(A1:D1)-COLUMN(A1),999,1))}

.. but it only gives a single cell, which always seems to be the count on the first column.

I know this could be easily solved in VBA but for several reasons (not least curiosity) I’d like to see if it can be solved in a single (probably array) formula.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:53:19+00:00Added an answer on June 8, 2026 at 2:53 am

    Maybe try this with CTRL+SHIFT+ENTER:

    =MAX(SUBTOTAL(3,OFFSET(A:D,,COLUMN(A:D)-MIN(COLUMN(A:D)),,1)))
    

    Any rectangular range can be used in place of A:D.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several different numbers in a group that range in sizes and would
I have two range sliders in my page, and I would like to implement
I have a range, containing numeric values & blank cells. Some of the numeric
I have two columns in excel like the following a,apple a,bannana a,orange a,plum b,apple
I have files with multiple columns and I want to read values from a
Basically I want to be able to categorize the column selected into different range
I have a table with columns ID(int), Number(decimal), and Date(int only timestamp). There are
I need to store 150 different tiny integer values (range from 0 to 7)
I have a sheet in which I'm entering values in cell from two different
I have different column names in a table in an Oracle database and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.