+ Reply to Thread
Results 1 to 6 of 6

Building a database-to find the data of last row for every row

  1. #1
    Registered User
    Join Date
    07-07-2017
    Location
    Tokyo
    MS-Off Ver
    2016
    Posts
    4

    Question Building a database-to find the data of last row for every row

    Hi guys, I am building a database for a sea of data.
    What I want to do is:
    When I type a text in a cell, the other cells in the same row would found the last matching data from the previous rows
    1.PNG

    And when I type "b" in cell A10, cell B10 will return "369"

    And sometime I would add some new data on the rows below, let say on row 13
    Are there any formula to retrieve the last data from all the previous rows
    (i.e. on row 14, the formula will return the data from row 1 to row 13,
    and on row 15, the formula will return the data from row 1 to row 14 and son on)
    Or do I need a VBA to complete the job

    Thank you so much and sorry for my bad English

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Building a database-to find the data of last row for every row

    Find this formula in B10 of the attached and fill down as far as needed.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  3. #3
    Registered User
    Join Date
    07-07-2017
    Location
    Tokyo
    MS-Off Ver
    2016
    Posts
    4

    Re: Building a database-to find the data of last row for every row

    Thank you Dave
    It works perfectly )
    Hope you have a good day

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Building a database-to find the data of last row for every row

    Good deal. You are welcome and thank you for the feedback.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  5. #5
    Registered User
    Join Date
    02-01-2018
    Location
    INDIA
    MS-Off Ver
    2013
    Posts
    18

    Re: Building a database-to find the data of last row for every row

    Hi Dave,

    its a nice work. can you please explain it - how it works.


    Thanks,
    Prabhu

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Building a database-to find the data of last row for every row

    I’ll do my best.

    LOOKUP(lookup_value, lookup_vector, [result_vector])
    =IFERROR(LOOKUP(2,1/(A10=$A$2:A9),$B$2:B9),"")

    Reference cell B10. The heart of the formula is in the lookup_vector.

    A10 is compared with all the items in the preceding rows $A$2:A9. If you select (A10=$A$2:A9) in the formula bar and hit the F9 function key you will see {FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE}. Any mathematical operation performed on TRUE/FALSE will coerce them into their underlying numeric values 1/0.

    Extend the selection in the formula bar to include 1/(A10=$A$2:A9) and hit the F9 function key. You will see the array {#DIV/0!;1;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;1;#DIV/0!}. LOOKUP is one of the functions that will ignore errors in the lookup_vector.

    LOOKUP will attempt to match lookup_value (2 in this case) to that array and find the right most value less than or equal to 2. It then returns the value from the [result_vector]) ($B$2:B9) corresponding to that match.

    As you fill the formula down the ranges $A$2:A9 and $B$2:B9 will increase as the comparison value in A10 will become A11, A12 … etc.

    You can also follow along using the ‘Evaluate formula’ feature under FORMULAS.

    The F9 and ‘Evaluate feature’ are excellent tools for analyzing, trouble shooting and self instruction.

    Does this help?

+ 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. Building a searchable database in Excel
    By AndrewCalum in forum Excel General
    Replies: 3
    Last Post: 10-11-2016, 04:52 AM
  2. database building issues
    By mmon in forum Excel General
    Replies: 0
    Last Post: 01-03-2013, 12:06 PM
  3. Help building a database
    By marcospaterson in forum Access Tables & Databases
    Replies: 1
    Last Post: 11-11-2011, 08:38 AM
  4. Using excel like a database: building a query
    By vwDavid in forum Excel General
    Replies: 12
    Last Post: 03-10-2011, 08:45 PM
  5. building a database from multiple same name files
    By babydebut in forum Excel General
    Replies: 0
    Last Post: 10-24-2007, 08:42 AM
  6. building database
    By chris1432 in forum Excel General
    Replies: 2
    Last Post: 11-29-2006, 06:04 PM
  7. [SOLVED] Building a zip code database
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2005, 01:40 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