+ Reply to Thread
Results 1 to 23 of 23

find last cell with data

Hybrid View

  1. #1
    Registered User
    Join Date
    01-09-2015
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    28

    find last cell with data

    Hello

    I dont know how to solve this. I have a lot of lines and columns, with a lot of articles. In same lines I could have OK, or NOK, OR NOK and OK.

    What i want is in a column, of the excell sheet, to see the final stake. OR OK OR NOK.

    Could you help me?cenas.JPG
    Last edited by FDibbins; 08-09-2018 at 02:26 PM.

  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,946

    Re: Doubt

    Hi, welcome to the forum

    For future reference, please take a moment to read the forum rules and use thread titles that are descriptive of your problem - not what you think the answer might be. (think google search terms?).

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    I have changed the title for you - this time
    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
    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,946

    Re: find last cell with data

    Also, pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc. Additionally, due to how some browsers behave, many of our members cannot see uploaded pictures/images. Please do not take this route.

    Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  4. #4
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: find last cell with data

    Hi,

    Yes, you should upload a file as suggested, or at least provide a sample in a Table format which potential helpers can copy and paste your data for testing, on top of that, the picture you show is so small, I can't really see what's going on.

    I think this is what you mean:

    Excel 2016 (Windows) 64 bit
    A
    B
    C
    1
    NOK
    2
    OK OK
    3
    OR NOK
    4
    NOK
    5
    NOK
    6
    OK
    7
    NOK
    8
    OK
    9
    10
    11
    12
    Latest Status NOK OK
    Sheet: Sheet24

    Excel 2016 (Windows) 64 bit
    B
    12
    =LOOKUP(REPT("z",255),B1:B10)
    Sheet: Sheet24

    Formula copied across.

  5. #5
    Registered User
    Join Date
    01-09-2015
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    28

    Re: find last cell with data

    Hello,

    Sorry for all mess that i cause.

    The problem is that i need the resolution in lines, and not in columns,
    I've tried this

    =if.error(PROCH("OK";H8:DJ8;1;true);"not done")

    and this

    =if(H8:DN88="OK";"OK";if(H8:DO8="NOK";"NOK";"Not done"))

    And no one i have solve the proble. The first on proch, because in the NOK, column in the next 2 columns i have the reasons of their NOK state, and them the excel gave me the last column text

    In the second, excel i think, dont read IF, in the line orientation, maybe, i dont know.

    I've sent you my sheet. Look to column STATE. If you saw and try to right in the lines, you will se the column change, but the proble is excell gave me the last word of the line.
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,275

    Re: find last cell with data

    This is a guess, because I have no idea what your expected results are:

    =LOOKUP(REPT("z";255);H3:AC3)

    copied down.

    If this is incorrect, please TELL US what your expected results are. Amend and re-post your sheet with the expected results.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  7. #7
    Registered User
    Join Date
    01-09-2015
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    28

    Re: find last cell with data

    Hello Glenn, Many thanks for reply. I've simplified the excel sheel

    ProcH is the Portuguese function for LOOKUP, so my function was:
    =if.error(lookup("OK";H8:DJ8;1;true);"not done")

    In the state, only have to appear, OK, NOK, NOT DONE. nothing more. Lack of fusion or porosity, i dont want to appear.

    Look, NOT OK, dont have appear, and excell allways give-me the column beside of NOK, give me for example LACK of FUSION.

    And i want, despite the defect that cause his reprove, i want in the state NOK, and not the defect

    Look to this another excell sheet
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,631

    Re: find last cell with data

    Is this closer to what you want:

    =LOOKUP(2,1/($B3:$W3<>"")*($B$1:$W$1<>"Defeito*"),$B3:$W3)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Registered User
    Join Date
    01-09-2015
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    28

    Re: find last cell with data

    Quote Originally Posted by AliGW View Post
    Is this closer to what you want:

    =LOOKUP(2,1/($B3:$W3<>"")*($B$1:$W$1<>"Defeito*"),$B3:$W3)
    Hello, thanks for reply. could you send me an example on my excell sheet?

    Regards

  10. #10
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2021
    Posts
    5,952

    Re: find last cell with data

    Try this:

    =IFERROR(LOOKUP(2,1/($B3:$W3<>"")/(LEFT($B$1:$W$1,7)<>"Defeito"),$B3:$W3),"NOT DONE")

    Or:

    =IFERROR(LOOKUP(2,1/($B3:$W3<>"")/ISNUMBER($B$1:$W$1),$B3:$W3),"NOT DONE")

  11. #11
    Registered User
    Join Date
    01-09-2015
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    28

    Re: find last cell with data

    Quote Originally Posted by Phuocam View Post
    Try this:

    =IFERROR(LOOKUP(2,1/($B3:$W3<>"")/(LEFT($B$1:$W$1,7)<>"Defeito"),$B3:$W3),"NOT DONE")

    Or:

    =IFERROR(LOOKUP(2,1/($B3:$W3<>"")/ISNUMBER($B$1:$W$1),$B3:$W3),"NOT DONE")
    Its not working

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,275

    Re: find last cell with data

    You may have simplified it... but you have NOT shown the expected results!!

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,275

    Re: find last cell with data

    I think I follow you... use this array formula:

    =INDEX(B3:W3,MAX((B3:W3={"OK";"NOK";"Not Done"})*MATCH(COLUMN(B3:W3),COLUMN(B3:W3))))&""

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

    See the sheet for EXACT use of , and ; separators in Portuguese...
    Attached Files Attached Files

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,275

    Re: find last cell with data

    This gets your "Not Found" response in as well:

    =IF(COUNTA(B3:W3)=0,"Not Found",INDEX(B3:W3,MAX((B3:W3={"OK";"NOK";"Not Done"})*MATCH(COLUMN(B3:W3),COLUMN(B3:W3))))&"")
    Attached Files Attached Files

  15. #15
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: find last cell with data

    Hi

    You can try this normal formula that gives the same results as @Glenn in last post (#14)

    Formula: copy to clipboard
    =IFERROR(INDEX(3:3,AGGREGATE(14,6,COLUMN($B3:$W3)/(($B3:$W3<>"")*(LEFT(B$1:W$1,7)<>"Defeito")),1)),"Não efetuado")

  16. #16
    Registered User
    Join Date
    01-09-2015
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    28

    Re: find last cell with data

    Hello,

    Only today i had some time to put the excell sheet in English and to demonstrate what i want.

    On the Column STATUS, I want, per line, to see, If a work made in a different day is OK, NOK, or NÃO EFETUADO (IS NOT DONE YET in English)

    In a Line I coud have, OK (the test piece is success in the first test), NOK (the test piece dont pass in first test) and NÃO EFETUADO (not done yet)

    I remember that NOK test piece, is necesary to repair and to do another test to see if is positive. IF is positive, the status must be OK, if not is NOK.

    The STATUS, must see, the Number (RBP 15 per example), is OK, NOK, or NOT DONE.

    Please see my formula by STATUS Column. Sometimes appears erros, and i dont know if is right the way it is.

    Could you help me?
    Attached Files Attached Files

  17. #17
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: find last cell with data

    Hi

    You can try this normal formula that gives the same results as @Glenn in last post (#14)

    Formula: copy to clipboard
    =IFERROR(INDEX(3:3,AGGREGATE(14,6,COLUMN($B3:$W3)/(($B3:$W3<>"")*(LEFT(B$1:W$1,7)<>"Defeito")),1)),"Não efetuado")


    PT formula:
    Formula: copy to clipboard
    =SE.ERRO(ÍNDICE(3:3;AGREGAR(14;6;COL($B3:$W3)/(($B3:$W3<>"")*(ESQUERDA(B$1:W$1;7)<>"Defeito"));1));"Não efetuado")

  18. #18
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: find last cell with data

    Hi João

    Try to use in column J from J8 de following formula
    Formula: copy to clipboard
    =IFERROR(INDEX(8:8,AGGREGATE(14,6,COLUMN(K8:DI8)/(K8:DI8<>""),1)),"Não efectuado")


    Note: I do not see the column STATUS. Column J? (FINAL STATE)

  19. #19
    Registered User
    Join Date
    01-09-2015
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    28

    Re: find last cell with data

    Yes. Final Ste is the correct column and not status

  20. #20
    Registered User
    Join Date
    01-09-2015
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    28

    Re: find last cell with data

    Hello,

    I think its working very well. But tomorrow i can give you the final answer

    Could you explain me the purpose of this formula, explain me step by step.

    Regards
    joão

  21. #21
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: find last cell with data

    Hi João

    I begin by explaining the third paramparent of the "AGGREGATE" function, that is, COLUMN (K8:DI8)/(K8:DI8<>"").

    COLUMN (K8:DI8) provides a vector with the numbers of these columns {11, 12, 13, 14, ... 61, ... 113} whose elements will be divided by

    (K8:DI8<>"") that is, in your case, {False, False, .... True, False .... False} (true in column(BI8)=61).

    In this division False will be 0 and True will be 1. Thus {11, 12, 13, 14, ... 61, ... 113} / {0, 0, 0, ..., 1, ... 0 } = {# DIV0 !, # DIV0 !, # DIV0 !, # DIV0 !, ..., 61, ..., # DIV0!}

    The AGGREGATE function 14 will determine the n largest value, 6 omitting errors, in the result vector {# DIV0 !, # DIV0 !, # DIV0 !, # DIV0 !, ..., 61, ..., # DIV0!} where n=1 represent the first largest value 61. The column 61 row 8 has the value "OK".

    I hope I have explained enough

    Do not forget to mark this thread as SOLVED.
    Last edited by José Augusto; 09-12-2018 at 05:48 AM.

  22. #22
    Registered User
    Join Date
    01-09-2015
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    28

    Re: find last cell with data

    Many many thanks for the knowledge.

    How do I classify as SOLVED this thread?

    Regards my Portughese friend

  23. #23
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: find last cell with data

    Hi João

    To mark the thread solved do the following:

    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    Regards.

+ 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. here is my doubt, please help me...
    By rubeshgar in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 06-22-2016, 02:32 AM
  2. doubt
    By rukman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2016, 08:48 AM
  3. Doubt in using array - VBA
    By vbamania in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-02-2013, 12:12 AM
  4. [SOLVED] Doubt in sum function...
    By ttrodrigues in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-12-2012, 06:29 PM
  5. A doubt
    By SSDESIKAN in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-29-2012, 10:27 AM
  6. [SOLVED] Excel 2007 : If and or If or formula doubt
    By lizsantiago07 in forum Excel General
    Replies: 6
    Last Post: 06-07-2012, 11:59 AM
  7. macro doubt
    By nowfal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2005, 06:23 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