+ Reply to Thread
Results 1 to 5 of 5

How do you code last row in a nested formula?

  1. #1
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Thumbs up How do you code last row in a nested formula?

    I asked this question in the formula forum: http://www.excelforum.com/excel-form...ed-ranges.html

    I reported it & asked that it be deleted I guess its more of a VBA question since thats really how I am doing my work anyway.

    So I know I am going to need to use cells just not sure of the syntax for this little nasty:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This is the recorded Macro which is less than helpful for me to understand what I need to do
    Please Login or Register  to view this content.
    I need to drop the "A46" & do a lastrow via cells I just never done it before & could use some help. TIA
    Last edited by dlow; 08-13-2014 at 08:56 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,788

    Re: How do you code last row in a nested formula?

    Look here for an example of how to do this:

    http://www.ozgrid.com/forum/showthread.php?t=56370
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: How do you code last row in a nested formula?

    BoOm Shaka Lacka thx @alansidman +1 rep & Solved, believe it or not I have been looking for this solution since Sunday.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: How do you code last row in a nested formula?

    One thing to note about that OzGrid solution, it's 8 years old and doesn't account for Excel 2007+ million+ rows. It starts looking up from row 65536 (max in Excel 2003-) to find the last used row. If your data contains more than that many rows, you won't get the correct last row. This may not apply to your situation, but for anyone else reading this thread in the future please take that into account.

    It's probably better to use something along the lines of:
    Please Login or Register  to view this content.
    Note: The formula in the above code is from the Oz page, not the solution to this problem.

  5. #5
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: How do you code last row in a nested formula?

    Thx Paul right-on thats what I wound up using.

    For anyone who came here from my prior post here: [http://www.excelforum.com/excel-form...-formula.html]
    Just want to mention that martindwilson is saying that my formula is wrong & I was willing to except that, but when I modified it the way he says it should be it changed the result & gives me the wrong answer.
    So my formula is correct & whether it was or not wasnt my question anyway.
    I simply needed to know how to reference the last row for my formula, it didnt have to be programmatically. I am flexible & would have been fine with either.

    I do believe the answer he could have offered if he knew it would have been: INDIRECT LOOKUP ROW


    In summary this:=IF(COUNTIF(A2:A39:A2:A39,A2)>1,A2,"") is a valid formula.
    It will give a differant result than: =IF(COUNTIF(A2:A39,A2)>1,A2,"") which happens to give me the wrong result for what I am doing.

    +1 Rep point for Pauls thoroughness
    Last edited by dlow; 08-16-2014 at 07:14 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to reduces Nested IF code(144 Nested IF) to achive same functionality
    By jobseeker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2014, 09:45 AM
  2. Nested IF/OR formula or vba code instead?
    By rachbendy in forum Excel General
    Replies: 2
    Last Post: 04-02-2009, 04:56 AM
  3. help on a nested countif/nested if formula
    By vickiemc in forum Excel General
    Replies: 2
    Last Post: 08-13-2008, 08:29 AM
  4. Alternative Code - Nested Ifs
    By gizoku00 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2008, 11:16 PM
  5. [SOLVED] Help: Nested If/And Function formula to VB code
    By RAP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2005, 01:05 AM

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