+ Reply to Thread
Results 1 to 7 of 7

ROW(A20) vs ROWS($A$1:A20), Which One is Faster?

  1. #1
    Registered User
    Join Date
    07-31-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    22

    ROW(A20) vs ROWS($A$1:A20), Which One is Faster?

    To get the row number of a cell, is ROW faster or ROWS faster?

    For example
    ROW(A20) vs ROWS($A$1:A20), which one is faster?

    I have hundreds of thousands of formulas containing these (many are inputs for other formulas) and I want to pick the more efficient one.

    (Furthermore, how about simply ROW() without parameter on the row where the target cell is located. Is it the fastest?)


    Thanks.
    Last edited by ceeyee; 10-16-2012 at 06:03 PM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: ROW(A20) vs ROWS($A$1:A20), Which One is Faster?

    These formulas return different results! =ROW(A20) returns the row of the reference. =ROWS(A1:A20) returns the number of rows in the selected range. If I choose =ROW(A2:A20), the formula will return 19.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Registered User
    Join Date
    07-31-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: ROW(A20) vs ROWS($A$1:A20), Which One is Faster?

    ROW(A20) and ROWS(A1:A20) both return 20.

    I have edited the original post to ROWS($A$1:A20) to avoid confusion.
    Last edited by Cutter; 10-17-2012 at 05:21 PM. Reason: Removed whole post quote

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,622

    Re: ROW(A20) vs ROWS($A$1:A20), Which One is Faster?

    @Thomas: ROWS($A$1:A20) ... the A1 reference is absolute. So the answer is the same, even when dragged down.

    I'd guess that =ROW(A20) would be quicker as the calculation is simpler, but it is just a guess.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: ROW(A20) vs ROWS($A$1:A20), Which One is Faster?

    I vote for =ROW(A20) as well, and use it myself as the prefered numeric incrementer.



    But, when in doubt, check it out.

    http://www.youtube.com/watch?v=HKbRNqcvhzs
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Registered User
    Join Date
    07-31-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: ROW(A20) vs ROWS($A$1:A20), Which One is Faster?

    Thanks for the link but the code mentioned is not compatible with Excel x64.
    Last edited by Cutter; 10-17-2012 at 05:20 PM. Reason: Removed whole post quote

  7. #7
    Registered User
    Join Date
    07-31-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: ROW(A20) vs ROWS($A$1:A20), Which One is Faster?

    I remember ROW returns arrays. Would that make it slower than ROWS?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1