+ Reply to Thread
Results 1 to 8 of 8

Trying to find the last non-empty cell in a specific row/range over multiple sheets

  1. #1
    Registered User
    Join Date
    03-21-2016
    Location
    Midwest, USA
    MS-Off Ver
    2013
    Posts
    4

    Trying to find the last non-empty cell in a specific row/range over multiple sheets

    I am working on an attendance workbook of sorts in Excel 2013. The workbook contains a Calculations sheet, a Lists sheet and a sheet for each month of the year. The Lists sheet has a list for names and a list for the months. I have included a link to a sample workbook to demonstrate how the sheets are setup and the basic functions, names, lists, etc that I am using.

    My sample workbook:
    https://app.box.com/s/mgvums1vmnmnec7e7d0p4vi5daoyo5nv

    When looking for the last non-empty cell in a specific row/range, I receive the correct result when I use the following LOOKUP on each specific Month sheet: (Which I found after some digging on a few sites) =LOOKUP(2,1/(C5:AG5<>""),C$4:AG$4)
    - For the Month of Feb, the last entry in the range C5:AG5 is in AA5, which is the 25th.

    I also receive the correct result when I use the following Lookup from any non-Month sheet: =LOOKUP(2,1/(Feb!C5:AG5<>""),Feb!C$4:AG$4)

    That being said, the two specific issues I am running into, are as follows:

    1. I have been unable to work out how to come up with the last non-empty cell (which is the last marked day of attendance) when using Name and Month information selected in the Combo Box/Form Controls. Simply said, in my sample workbook, I want to know the last day in Feb that Johnny was in attendance.

    I've tried starting simple, just using the "Month" I selected. I tried a few different itterations of the following:
    =LOOKUP(2,1/(Month&"!C5:AG5<>"""),Month&"!C$4:AG$4")
    The closest I've gotten was the above Lookup, which ends up turning into what you see below (when viewed in Calculation steps). It of course returns a #VALUE! error.
    =LOOKUP(2,1/"Feb!C5:AG5<>""",Month&"!C$4:AG$4")

    2. I have been unable to work out how to come up with the last non-empty cell across all the Month sheets when using the selected Name from the Combo Box/Form Control. Basically, I want to know the last day of the year that Johnny was in attendance. In this sample workbook, that would fall on April 11th. I understand that the formula would just return "11". I believe I can format the result after the fact, using the resulting sheet name. (In this sample case, Apr)

    I am fairly certain I will need to use a VLOOKUP. I just can't seem to break the barrier between the general concepts of what I want and the proper way of formulating it.

    Any help would be appreciated. I'm feeling pretty lost at the moment. If you need more info from me, please let me know.

    Thanks,
    Kurewe

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Trying to find the last non-empty cell in a specific row/range over multiple sheets

    I didn't download your file.

    Did you set a linked cell for the combo box?

    Do you know that the linked cell will return the index number of the selected item. It will not return the actual selected item itself. For example...

    The combo box selections might be:

    A
    B
    C
    D
    E

    If you select C the linked cell returns 3 because C is the 3rd item in the list.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    03-21-2016
    Location
    Midwest, USA
    MS-Off Ver
    2013
    Posts
    4

    Re: Trying to find the last non-empty cell in a specific row/range over multiple sheets

    Tony,

    Thanks for the reply.

    Yes, I did set a Cell Link. So, the Name Selector is linked to Lists!$A$1.
    Lists!$A$2 then has =INDEX(NameList,A1,1)
    Lists!$A$2 was then setup in Names Manager as "Name"

    I did the same for Month as well.

    Thanks,
    Kurewe

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Trying to find the last non-empty cell in a specific row/range over multiple sheets

    So, then this:

    Quote Originally Posted by Kurewe View Post
    Lists!$A$2 then has =INDEX(NameList,A1,1)
    Returns the month name that is supposed to be used in this:

    =LOOKUP(2,1/(Month&"!C5:AG5<>"""),Month&"!C$4:AG$4")

  5. #5
    Registered User
    Join Date
    03-21-2016
    Location
    Midwest, USA
    MS-Off Ver
    2013
    Posts
    4

    Re: Trying to find the last non-empty cell in a specific row/range over multiple sheets

    In my sample sheet:
    Please Login or Register  to view this content.
    Should have been returning the Month name in this:
    Please Login or Register  to view this content.
    However, after I entered the formula, it returned something like:
    Please Login or Register  to view this content.
    Which, gave a #VAlUE! error. It replaced the 2nd "(" and the 1st ")" with quotation marks.

    Failing to be able to resolve that led me to finally posting for assistance. I actually received a solution from another site that appears to do exactly what I needed to do. You can take a look at the solution using the following link.
    Working Solution

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Trying to find the last non-empty cell in a specific row/range over multiple sheets

    Good deal. Thanks for the feedback!

  7. #7
    Registered User
    Join Date
    03-21-2016
    Location
    Midwest, USA
    MS-Off Ver
    2013
    Posts
    4

    Re: Trying to find the last non-empty cell in a specific row/range over multiple sheets

    Tony,

    I just received the following, which is far more simple than what was provided in the link I shared. These are much closer to what I was hoping for. Only issue is that the 2nd LOOKUP below only gives the Month of the last entry. I replied to the poster and asked if there was a way to have it return Month and Day (i.e. "APR 11" or the less preferable "11")

    This one results in the last attended day for the chosen name and chosen Month
    Please Login or Register  to view this content.
    and

    This one should result in the Day # or the more preferable Month & Day # for the last entry of the year. Currently, only results in the month of the last entry of the year.
    Please Login or Register  to view this content.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Trying to find the last non-empty cell in a specific row/range over multiple sheets

    To avoid duplication of effort, I'll wait until you've received as much help as can be offered from that other site.

    If after a reasonable amount of time you still haven't received a solution then let me know and I'll help as much as I am able.

+ 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 select next empty cell in row for a specific range?
    By 9mouse in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2016, 08:28 AM
  2. disable printing if specific cells are empty - multiple sheets-
    By zanael in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2014, 08:37 PM
  3. [SOLVED] Find next empty cell (Row)within a specific range in column A
    By JRidge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2014, 05:39 AM
  4. [SOLVED] Select the last empty cell of the range specific
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2013, 09:48 AM
  5. Macro to find next empty cell in specific range
    By boatbabe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2013, 09:18 AM
  6. [SOLVED] How do you search through multiple sheets to find a specific value?
    By bean29 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 10:07 AM
  7. Find first empty row in a specific range
    By orlando_javier in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2010, 03:09 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