+ Reply to Thread
Results 1 to 11 of 11

How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

  1. #1
    Forum Contributor
    Join Date
    12-16-2014
    Location
    Riverside, IA
    MS-Off Ver
    2010
    Posts
    156

    How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    Hello,

    The columns are:

    H648:H668

    L648:L668

    P648:P668

    T648:T668

    But the formula also needs to find the highest row number if the columns are of unequal length. For example, if there is data only in cells H648:H663 and L648:L652, the formula would need to select H663.

    is this doable?

    Thank you,

    Patrick

  2. #2
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    Hi EverClever, this should work for you:-
    Please Login or Register  to view this content.
    It's an array so you'll have to enter it with Ctrl-Shift-Enter

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    Quote Originally Posted by EverClever View Post
    For example, if there is data only in cells H648:H663 and L648:L652, the formula would need to select H663.
    Hello Patrick,

    Does that mean you want to return the value from H663?

    What if H663 has a value and so does P663, which one do you want?
    Audere est facere

  4. #4
    Forum Contributor
    Join Date
    12-16-2014
    Location
    Riverside, IA
    MS-Off Ver
    2010
    Posts
    156

    Re: How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    daddylonglegs,

    The answer to your question is P663. It has to be the value in the highest row number and furthest right column letter.

    Thanks,

    Patrick

  5. #5
    Forum Contributor
    Join Date
    12-16-2014
    Location
    Riverside, IA
    MS-Off Ver
    2010
    Posts
    156

    Re: How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    Beamermsw,

    Thank you for your formula. I entered the formula just for the H row w/ the CTRL-SHIFT-ENTER and the result was incorrect:

    {=MAX(IF(H648:H668<>"",ROW(H648:H668)))} = 664 Correct answer is 165 which is the last value and is in Cell H663.

    Thanks,

    Patrick

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    It would be a little easier if you have some sort of header value which identifies the 4 columns, does that exist? If not then you can use this array formula to find the value you want

    =LOOKUP(9.99E+307,(""&INDEX(H648:T668,MAX(IF(MOD(COLUMN(H648:T668)-COLUMN(H648),4)=0,IF(ISNUMBER(H648:T668),ROW(H648:T668)-ROW(H648)+1))),0))/(MOD(COLUMN(H648:T668)-COLUMN(H648),4)=0))

    confirmed with CTRL+SHIFT+ENTER

    If there are no numbers in those columns you get #N/A

  7. #7
    Forum Contributor
    Join Date
    12-16-2014
    Location
    Riverside, IA
    MS-Off Ver
    2010
    Posts
    156

    Re: How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    daddylonglegs,

    The 2 word column headings are all in Rows 645 and 646:

    The column headings are #1 in the first row and HR in the second row for column H;

    The column headings are #2 in the first row and HR in the second row for column L.

    The column headings are #3 in the first row and HR in the second row for column P.

    The column headings are #4 in the first row and HR in the second row for column T.

    Should I try out your revised formula or wait for you to include the column headings above?

    Thanks again,

    Patrick

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    My original suggestion should work OK, but based on having "HR" in row 646 for the relevant columns (and no instances of "HR" on that row for the other columns) this shorter version should also work

    =LOOKUP(9.99E+307,(""&INDEX(H648:T668,MAX(IF(H646:T646="HR",IF(ISNUMBER(H648:T668),ROW(H648:T668)-ROW(H648)+1))),0))/(H646:T646="HR"))

    confirmed with CTRL+SHIFT+ENTER

  9. #9
    Forum Contributor
    Join Date
    12-16-2014
    Location
    Riverside, IA
    MS-Off Ver
    2010
    Posts
    156

    Re: How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    daddylonglegs,

    Your revised formula below came back with 0; correct answer still 165


    {=LOOKUP(9.99E+307,(""&INDEX(H648:T668,MAX(IF(H646:T646="HR",IF(ISNUMBER(H648:T668),ROW(H648:T668)-ROW(H648)+1))),0))/(H646:T646="HR"))} = 0

    Your previous revised formula below came back also with 0 ; correct answer still 165

    =LOOKUP(9.99E+307,(""&INDEX(H648:T668,MAX(IF(MOD(COLUMN(H648:T668)-COLUMN(H648),4)=0,IF(ISNUMBER(H648:T668),ROW(H648:T668)-ROW(H648)+1))),0))/(MOD(COLUMN(H648:T668)-COLUMN(H648),4)=0)) = 0


    Appreciate your continued help!

    Patrick

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    OK, they both work with my tests but perhaps I don't have the data set up correctly.

    Did you confirm the longer one with CTRL+SHIFT+ENTER?

    The formula could return zero as a valid result if you actually have zeroes in the cells. You say 165 is in H663, so I assume H664, for example, is blank (not zero), is that right?

    If zero isn't ever a valid result try this version

    =LOOKUP(9.99E+307,1/(1/INDEX(H648:T668,MAX(IF(H646:T646="HR",IF(ISNUMBER(1/H648:T668),ROW(H648:T668)-ROW(H648)+1))),0)/(H646:T646="HR")))

    still confirmed with CTRL+SHIFT+ENTER
    Last edited by daddylonglegs; 04-05-2015 at 12:37 PM.

  11. #11
    Forum Contributor
    Join Date
    12-16-2014
    Location
    Riverside, IA
    MS-Off Ver
    2010
    Posts
    156

    Re: How to Find the Last Number in a Series of Non-Adjacent Columns with 1 Exception

    daddylonglegs,

    I am so sorry for the delayed response as life has been hectic the last couple of weeks. Anyway, I wanted to get back to you to say that your revised formula worked and I am gratefully appreciative of all your efforts!

    Patrick

+ 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. Replies: 1
    Last Post: 05-29-2014, 09:34 PM
  2. [SOLVED] Need formula to find the next value in series by comparing values of adjacent cells
    By warriorpoet7176 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-13-2014, 06:55 AM
  3. Find a number and replace the adjacent cell with other number
    By shafath03 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2013, 09:09 PM
  4. Replies: 0
    Last Post: 04-04-2013, 10:23 PM
  5. Do Until / Loop code to find max value in many adjacent columns?
    By vcchin in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-20-2010, 08:10 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