+ Reply to Thread
Results 1 to 11 of 11

Displaying the penultimate rightmost data in a row with sparse data

  1. #1
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Newport, England
    MS-Off Ver
    Excel 2013 Windows
    Posts
    144

    Displaying the penultimate rightmost data in a row with sparse data

    Thank you to everyone who has helped me over the past few days, can't thank you all enough!

    The other day I was kindly helped regarding a query I had in being able to find the rightmost piece of data in a sparse row with the formula:

    =IF(COUNT(G2:BE2)=0,"",LOOKUP(100000000000,G2:BE2))

    I am also wondering if it's possible to find the penultimate rightmost data in the row and even the one preceding that? This seems extremely complicated!

    many thanks!

  2. #2
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Newport, England
    MS-Off Ver
    Excel 2013 Windows
    Posts
    144

    Re: Displaying the penultimate rightmost data in a row with sparse data

    Sorry for reposting this, but I am wondering if someone could help who may not have seen this?

    I am desperate to calculate the penultimate rightmost data entry in a sparsley populated row. I don't even know if this can be done? Any help would be fantastic!

    thanks again!

  3. #3
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Displaying the penultimate rightmost data in a row with sparse data

    Here's one tinker ...
    Array-enter (ie press CTRL+SHIFT+ENTER to confirm the formula) into say, A2:
    =IF(COUNTA(G2:BE2)=0,"",INDEX(G2:BE2,LARGE(IF(G2:BE2<>"",COLUMN(G2:BE2)),2)-MIN(COLUMN(G2:BE2))+1))
    --------------------
    Yes? Wave it, hit the little star at the bottom left of my response

  4. #4
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Newport, England
    MS-Off Ver
    Excel 2013 Windows
    Posts
    144

    Re: Displaying the penultimate rightmost data in a row with sparse data

    Hey, It just returns #VALUE! Have I done something wrong?

  5. #5
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Newport, England
    MS-Off Ver
    Excel 2013 Windows
    Posts
    144

    Re: Displaying the penultimate rightmost data in a row with sparse data

    Once I worked out array-enter it worked brilliantly! Thank you so much!!! Unfortunately the rows with 1 or 0 entries return #NUM!, can this be fixed at all?

  6. #6
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Displaying the penultimate rightmost data in a row with sparse data

    Just change the front error trap: =IF(COUNTA(G2:BE2)=0,"", ...
    to this: =IF(COUNTA(G2:BE2)<2,"", ...
    -------------
    Yess? Hit the little star at the bottom left of my response

  7. #7
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Newport, England
    MS-Off Ver
    Excel 2013 Windows
    Posts
    144

    Re: Displaying the penultimate rightmost data in a row with sparse data

    Still returns #NUM!

  8. #8
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Displaying the penultimate rightmost data in a row with sparse data

    Unable to test right now over here, but you could try ISERROR to trap all errors (can dump the COUNTA check)
    Indicatively it looks like this:
    =IF(ISERROR(INDEX(...)),"",INDEX(...))
    where INDEX(...) is the core expression given earlier
    ------------------
    Checks out fine?, hit it ... that little star at the bottom left of my responses

  9. #9
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Newport, England
    MS-Off Ver
    Excel 2013 Windows
    Posts
    144

    Re: Displaying the penultimate rightmost data in a row with sparse data

    Hey, I tried (E2):

    =IF(ISERROR(INDEX(I2:FF2,1,0)),"",INDEX(I2:FF2,LARGE(IF(I2:FF2<>"",COLUMN(I2:FF2)),2)-MIN(COLUMN(I2:FF2))+1))

    but still returns a #NUM! error. Thanks for all your help so far!

  10. #10
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Displaying the penultimate rightmost data in a row with sparse data

    What I meant in the indicatives was to put the same Index(...) within the ISERROR, like this:
    =IF(ISERROR(INDEX(I2:FF2,LARGE(IF(I2:FF2<>"",COLUMN(I2:FF2)),2)-MIN(COLUMN(I2:FF2))+1))),"",INDEX(I2:FF2,LARGE(IF(I2:FF2<>"",COLUMN(I2:FF2)),2)-MIN(COLUMN(I2:FF2))+1))

  11. #11
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Newport, England
    MS-Off Ver
    Excel 2013 Windows
    Posts
    144

    Re: Displaying the penultimate rightmost data in a row with sparse data

    Thats superb thank you!

+ 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