+ Reply to Thread
Results 1 to 15 of 15

How to find last item in column for the dropdown list

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    How to find last item in column for the dropdown list

    Hi,

    i am using this formula:

    =OFFSET(A:A,1,0,COUNTA(A:A)-1,1) to find last item in column.

    Problem is that i have blank like here:
    Null
    Value
    Value

    and countA does not include empty here so my list is shorter.

    Screenshot_29.png

    do you know how to solve the issue?

    Jacek

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to find last item in column for the dropdown list

    To find last row of text try: =match("zzzzz",CA1:CA200)
    To find last row of text try: =match(9^99,CA1:CA200)

    To find last row text or Number
    =IF(ISERROR(MATCH(9.999999E+306,CA1:CA200)),MATCH("*",CA1:CA200,-1),
    IF(ISERROR(MATCH("*",CA1:CA200,-1)),MATCH(9.999999E+306,CA1:CA200),
    MAX(MATCH(9.999999E+306,CA1:CA200),MATCH("*",CA1:CA200,-1))))
    Last edited by mehmetcik; 02-25-2020 at 07:12 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: How to find last item in column for the dropdown list

    perhaps
    =OFFSET(A1,1,0,LOOKUP(1,1/(A2:A20<>""),ROW(A2:A20)-1),1) make the 20 as large as you need it to be

  4. #4
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: How to find last item in column for the dropdown list

    Thank you Guys,

    Please Login or Register  to view this content.
    This is formula is so big, can not be different?

    Please Login or Register  to view this content.
    this is better but i have to do this on whole column.

    Best,
    Jacek

  5. #5
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: How to find last item in column for the dropdown list

    edit: deleted
    Do you want to get last row number or value from last row?
    Please Login or Register  to view this content.
    Usage:
    Please Login or Register  to view this content.
    Last edited by KOKOSEK; 02-26-2020 at 05:41 AM.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  6. #6
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: How to find last item in column for the dropdown list

    Hi Janusz,

    i am attaching example.

    =OFFSET(Sheet1!$A$2;0;0;COUNTA(Sheet1!A:A)-1;1)

    and you can see that result is {0,"TableA"} instead of "","TableA","TableB").

    So i want to include blank here and replace 0 to "" to have list with 3 items including empty.

    Jacek
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: How to find last item in column for the dropdown list

    I agree with the above

    OFFSET(A:A,1,0,COUNTA(A:A)-1,1) suggests a range as the height attribute is completed

    =OFFSET(A1,1,0,LOOKUP(1,1/(A2:A20<>""),ROW(A2:A20)-1),1) would give the last row number

    LOOKUP(1,1/(A2:A20<>""),A2:A20) would give the last value as would

    LOOKUP(1,1/(A:A<>""),A:A)if you really need the full column

  8. #8
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: How to find last item in column for the dropdown list

    Quote Originally Posted by jaryszek View Post
    Janusz,?
    Check attached file.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: How to find last item in column for the dropdown list

    Thank you!

    working like a charm,

    already written by mehmetcik :

    MATCH("ZZZZZ";A:A;1)

    Why this is looking for last row? How this is workinf? I do not have "ZZZZ" string anywhere?

    Jacek

  10. #10
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to find last item in column for the dropdown list

    To find last row of text try: =match("zzzzz",A:A)
    To find last row of numbers try: =match(9^99,A:A)
    Last edited by mehmetcik; 02-26-2020 at 07:59 AM.

  11. #11
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: How to find last item in column for the dropdown list

    Ok how this is working?

    Jacek

  12. #12
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: How to find last item in column for the dropdown list

    Quote Originally Posted by jaryszek View Post
    I do not have "ZZZZ" string anywhere?
    But by MATCH excel wants to find it and goes into the end. Read about how MATCH function works (last parameter!).
    Last edited by KOKOSEK; 02-26-2020 at 06:12 AM.

  13. #13
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: How to find last item in column for the dropdown list

    Thanks!

    There is:

    MATCH finds the largest value that is less than or equal to lookup_value. The values in the lookup_array argument must be placed in ascending order, for example: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE.
    So the largest value in column is the last item. But this item is not equal or not even less than "ZZZZ"...

    Jacek

  14. #14
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: How to find last item in column for the dropdown list

    Every words is less than ZZZZ.

  15. #15
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: How to find last item in column for the dropdown list

    aaa ok got it!

    Thank you !

    Jacek

+ 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. [SOLVED] Show first item in dropdown list instead of blank with VBA
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-12-2018, 03:44 PM
  2. Remove items from dropdown list when item value = 0
    By technolog in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-21-2017, 09:57 AM
  3. [SOLVED] Find item(s) in a cell and match to item(s) in a list
    By seleseped in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-11-2017, 12:06 PM
  4. Help with VBA, find Item from list then sum totals of each item by type
    By HR_GUY in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2013, 01:30 PM
  5. Combobox Dropdown List only shows first Item
    By Guido Meng in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 09:49 PM
  6. Replies: 8
    Last Post: 01-23-2012, 10:28 AM
  7. [SOLVED] How can I set up to chose more than 1 item from a dropdown list (.
    By microchick in forum Excel General
    Replies: 4
    Last Post: 04-07-2005, 02:06 PM

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