+ Reply to Thread
Results 1 to 5 of 5

Search and Matching issue

Hybrid View

  1. #1
    Registered User
    Join Date
    09-25-2012
    Location
    Halifax, NS
    MS-Off Ver
    Excel 2010
    Posts
    2

    Search and Matching issue

    Hello everybody. I am trying to figure out what I consider to be a very difficult problem in Excel, and I am having no luck on the internet searching an answer. My job depends on me figuring this out!

    Let's say I have two columns, Column 1, which contains a range of values, many of them are repeating, and column 2, which contains useful information corresponding to the values in column 1. Like this:

    Col1: Col2:
    1 74
    2 3
    3 -78
    3 4
    3 9
    4 0
    5 74
    5 6
    5 4
    5 4
    5 78
    6 3
    7 74
    8 4
    9 1

    I would like to be able to select a value which I know occurs in col1, then search among the corresponding values in col2 to find the min/max. For example, Lets say I will search for 5, and return the maximum corrsponding value in col2. I want the cell to return 78.

    I know I need to use arrays, index, match, and possibly frequency, but I can't put it all together. Thank you so much in advance!!!

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Search and Matching issue

    Try

    =max(if(a1:a1000=5;b1:b1000))

    =min(if(a1:a1000=5;b1:b1000))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Search and Matching issue

    hi trianglet, welcome to the forum. assuming your data is from A1:A15, you can copy this formula into the formula bar:
    =MAX(IF(A1:A15=5,B1:B15))

    and press CTRL + SHIFT + ENTER to confirm

    you can also place the number 5 somewhere say in C1 to change the criteria more easily & see the change:
    =MAX(IF(A1:A15=C1,B1:B15))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    09-25-2012
    Location
    Halifax, NS
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Search and Matching issue

    Thank you so much for your speedy response, and thank you for your welcome. I will spend more time here and help people less knowledgable than myself to pay it forwards.

    Can I ask a followup question? My question is a little more complicated in "real life", than it is in my simplified example. In reality, my columns are more like this:

    col1 col2
    3.054 223
    4.893 890
    5.145 -3222

    And the value I'm searching for can be anywheres in the middle, say, 4.5. Can the function be modified to check for the closest available value, in this case 4.893? Thanks again, and if you don't have time to help again, I understand!

  5. #5
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Search and Matching issue

    Deleted post
    Last edited by Kevin UK; 09-26-2012 at 04:13 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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