+ Reply to Thread
Results 1 to 6 of 6

Search 2 colums, display the value of a cell between the two results.

  1. #1
    Registered User
    Join Date
    09-03-2008
    Location
    Dallas Texas
    Posts
    35

    Search 2 colums, display the value of a cell between the two results.

    I have three colums of data.

    Column A contains valuse like this : 44a, 44u, 44b, 44a, 44u etc..
    Notice that some of the values repeat.

    Column B contains values that represent length in feet: 12, 10, 8, 15, 17 etc..

    Column C is similar to column A : 44u, 44c, 44u, 44b, 44s etc..
    Again Notice that some of the values repeat.

    I want to search for a value in col. A and Col C and if they equil what im searching for display the length.

    Exampl: I enter the first location in cell d1, and the second location in cell d2
    I would like to then search Col. A for the first loc. and Col. C for the second loc. and return the corrasponding length from col b.

    I have tried the following code and connot get it to work correcly.


    =IF( (MATCH(C11, A2:A6, 0)) = (MATCH(C12, C2:C6, 0) ), INDIRECT(CONCATENATE("B", (MATCH(C11, A2:A6, 0) ) ) ), "LENGTH NOT FOUND")

    I dont know where to begin when using a function that will keep searching and not just stop at the first match.

    I have attached a sample of what i am trying to do.
    Attached Files Attached Files
    Last edited by shg; 09-14-2008 at 12:34 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    you need this array formula
    Please Login or Register  to view this content.
    confirm it with ctrl+shift+enter
    so {} appear around it
    like this
    Please Login or Register  to view this content.
    Last edited by martindwilson; 09-14-2008 at 09:29 AM.

  3. #3
    Registered User
    Join Date
    09-03-2008
    Location
    Dallas Texas
    Posts
    35
    Thanks martindwilson! That works great.

    Is there a way to have it preform the same function on text that might not match exactly what is being search, returning the nearest match?

    example: instead of jsut having the values 44u, 44a, etc.. the data looks more like.

    Col. A = rcdn9-44u-oobsw1
    Col. B = 14
    Col. C = 44U/C4

    If the user searches for 44u-oobsw1 and 44u the return value would be 14.
    I dont know if that is possable.

    Again thanks. The first option you gave works if they enter the exact names, witch is awesome in its self.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    i cant think of a way
    but thats not to say it cant be done
    depends on how mant different items there are
    you could use validation lists to force user to only choose say 44u
    but the first step would be to only have your table containing those values as in your posted spread sheet
    it should be possible to extract them from the longer strings depending on the format
    post a list of them

  5. #5
    Registered User
    Join Date
    09-03-2008
    Location
    Dallas Texas
    Posts
    35
    Here is a sample of what the lists look like. In the end I am trying to get the cable length to auto populate based on what they type into the device fields.
    It works right now based on the code you gave me earlier but only if they type it exactly.

    I do like you idea of the drop down list. I am going to explore that further.


    Please Login or Register  to view this content.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    Fortunately the device codes follow a similar pattern so its easy to extract 44u etc see attached
    i covered the possibility the shorter description may be in the first column
    formulas in col e and g and dragged down
    i'd do that first
    then copy paste back special values
    then use that table for your lookup
    you could remove duplicates if you like
    select the 3 columns
    go to data/filter /advanced filter
    check the copy to another location
    check the unique records only box

    click in the "copy to" window to select it then
    click a cell in an empty column(make sure the next two are empty as well )click ok
    Attached Files Attached Files

+ 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. search and move active cell to matched data
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-13-2008, 06:56 PM
  2. How to Pick Value of adjacent cell when Search is true
    By tushar@excel in forum Excel General
    Replies: 3
    Last Post: 08-11-2008, 12:36 PM
  3. search for max date and display other cell value
    By cdavenpo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-21-2008, 05:25 PM
  4. Search for and extract word from a cell
    By hmatharo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-30-2007, 10:21 PM
  5. PLEASE HELP! How to display the last cell used in a column?
    By britlizard in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-31-2007, 05:13 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