+ Reply to Thread
Results 1 to 9 of 9

Finding first (and last) entry in a long row

  1. #1
    Registered User
    Join Date
    01-27-2015
    Location
    Lubbock, Texas
    MS-Off Ver
    Excel for Mac 2011
    Posts
    5

    Finding first (and last) entry in a long row

    I am looking for a simple formula to find the position of the first non-blank entry in a long row of cells. I am also looking for another simple formula to find the position of the last non-blank entry in the same long rom of numbers. The enclosed spreadsheet has three lines of examples with the desired answers in the yellow highlighted cells.

    I can used a long series of nested IF statements but there must be a easier solution. None of the built-in functions seem to provide a solution. I have also looked through many previous posts without finding a solution.

    Thanks for any help.
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Finding first (and last) entry in a long row

    Hi, welcome to the forum

    Try this for the 1st...
    =MATCH(1,D3:Z3,-1)

    And this for the last...
    =MATCH(1,D3:Z3,1)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-27-2015
    Location
    Lubbock, Texas
    MS-Off Ver
    Excel for Mac 2011
    Posts
    5

    Re: Finding first (and last) entry in a long row

    Thank you so much. It worked perfectly with the supplied data, but does not work with other data. I am uploading a revised worksheet with more realistic data.
    Last edited by lubbockdutchman; 01-30-2015 at 02:56 PM. Reason: Solution did not work in general, just for the initial supplied data.

  4. #4
    Registered User
    Join Date
    01-27-2015
    Location
    Lubbock, Texas
    MS-Off Ver
    Excel for Mac 2011
    Posts
    5

    Re: Finding first (and last) entry in a long row

    Thank you so much FDibbins. It worked perfectly with the initial supplied data; however, it does not work with other data. I have uploaded a revised worksheet with data.
    Attached Files Attached Files
    Last edited by lubbockdutchman; 01-31-2015 at 12:49 AM.

  5. #5
    Registered User
    Join Date
    01-31-2015
    Location
    Raleigh, NC, USA
    MS-Off Ver
    2010
    Posts
    4

    Re: Finding first (and last) entry in a long row

    Okay I'm a forum newbie but I took a stab at it.

    To get the first (cell AB)
    Please Login or Register  to view this content.
    and the last (cell AC)
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-27-2015
    Location
    Lubbock, Texas
    MS-Off Ver
    Excel for Mac 2011
    Posts
    5

    Re: Finding first (and last) entry in a long row

    Thanks Steebo! Your formulas work correctly when entered as array formulas {Control+Shift+Enter}.

    An alternative to the MATCH formula to find the first entry would be:

    Please Login or Register  to view this content.
    Note that the -3 would need to be adjusted if the first column of interest was other than column "D".

    I only wish that there were a simpler and more intuitive formula.

  7. #7
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Finding first (and last) entry in a long row

    Quote Originally Posted by lubbockdutchman View Post
    [...]
    A3, copied down:

    =MATCH(TRUE,INDEX(ISNUMBER(D3:Z3),0),0)

    B3, copied down:

    =MATCH(9.99999999999999E+307,INDEX(1/D3:Z3,0))

  8. #8
    Registered User
    Join Date
    01-27-2015
    Location
    Lubbock, Texas
    MS-Off Ver
    Excel for Mac 2011
    Posts
    5

    Re: Finding first (and last) entry in a long row

    Aladin your solution works very well! The functions are not array formulas which is also an advantage.

    I do not understand one part of the formula - the "1/". It also works without it. I can not find any other sources which describe the use of the "1/". What is its purpose?

  9. #9
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Finding first (and last) entry in a long row

    Quote Originally Posted by lubbockdutchman View Post
    Aladin your solution works very well! The functions are not array formulas which is also an advantage.

    I do not understand one part of the formula - the "1/". It also works without it. I can not find any other sources which describe the use of the "1/". What is its purpose?
    That would allow you to exclude 0 entries. If that's not intended, we have to drop the division:

    =MATCH(9.99999999999999E+307,INDEX(D3:Z3,0))

+ 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] =IF and =SUMIF formulas creating long long long data processing times.
    By comp in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 03-26-2014, 02:59 PM
  2. [SOLVED] Finding opening, high, low, close in long list of prices
    By oceanfront in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-25-2012, 07:12 AM
  3. Identifying first entry in long list of duplicates?
    By Jamon39 in forum Excel General
    Replies: 2
    Last Post: 05-03-2010, 07:05 AM
  4. Finding the max date in a subgroup of a long list
    By splashback in forum Excel General
    Replies: 2
    Last Post: 06-05-2007, 05:13 PM
  5. [SOLVED] need help finding a Date range within long list
    By A shink in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-30-2005, 12:06 PM

Tags for this Thread

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