+ Reply to Thread
Results 1 to 13 of 13

Excel search

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    11

    Excel search

    Hi, I have a had this problem multiple times. I have columns A, B, C and in A I have running number from 1,2,3... in B, C I have names. I would like to create a search, where it would search columns B, C for the names I have chosen. When it finds those names on a same row, it would return me biggest number on the running column A.

    So, trying to find names Joe and Krista on columns B, C (does not matter if Joe is in C and Krista is in B, or other way around) it would return me that rows running number from A. There is multiple times when Joe and Krista meet so that is why largest/latest meeting. Hopefully you understand. Thanks in advance.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Excel search

    Assuming that running numbers from A1:A8
    Names are in B1:C8
    D1 and E1 contains 2 names
    Try this:
    =MAX(LOOKUP(2,1/(B1:B8&C1:C8=D1&E1),A1:A8),LOOKUP(2,1/(B1:B8&C1:C8=E1&D1),A1:A8))
    Find "JoeKrista" and "KristaJoe" in combination of the two name columns, then using MAX to get the last position from both results
    Does it meet?
    Quang PT

  3. #3
    Registered User
    Join Date
    01-16-2013
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    11

    Talking Re: Excel search

    Nicely done, really happy man here

  4. #4
    Registered User
    Join Date
    01-16-2013
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Excel search

    one more thing, if I wanted to do it with a LARGE function just get earlier meeting also, how would I go and change it?

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Excel search

    This is interesting question and I like to deal with it!
    We are comparing the last 2 meeting with MAX to get the larger, now we use MIN to find the smaller (= the earlier meeting also)

  6. #6
    Registered User
    Join Date
    01-16-2013
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Excel search

    if there are 50 meetings? I thought LARGE would be a way to go.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Excel search

    Sorry pls ignore #5 I've just found the error.
    The correct should be:
    =LARGE(IF((B1:B8&C1:C8=D1&E1)+(B1:B8&C1:C8=E1&D1)=1,ROW(B1:B8),""),2)
    Mark 1 for the meeting position, then mark the row number, then use LARGE with 2 to get the earlier meeting

  8. #8
    Registered User
    Join Date
    01-16-2013
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Excel search

    Thanks, will try it right away.

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Excel search

    Quote Originally Posted by hakki13 View Post
    if there are 50 meetings? I thought LARGE would be a way to go.
    50 or 100, no matter, because I am finding last position of Name1-Name2 and Name2-Name1. I found error to use the MIN because if there are 2 Name1-Name2 as latest meeting, MIN still returns the last pos of Name2 - Name1

  10. #10
    Registered User
    Join Date
    01-16-2013
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Excel search

    Ok, I get your point, but this is not getting the largest value in column A, right? this is giving me largest row number?? Sry, for being pain in the ****.

  11. #11
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Excel search

    I understand now.
    Try this

    =LARGE(IF((B1:B8&C1:C8=D1&E1)+(B1:B8&C1:C8=E1&D1)=1,A1:A8,""),2)

    Confirmed with holding both ctrl-shift, then enter

    Returns value in A1:A8 instead of row number

  12. #12
    Registered User
    Join Date
    01-16-2013
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Excel search

    Great, this works perfectly.

  13. #13
    Registered User
    Join Date
    01-16-2013
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Excel search

    Hi,

    Small continuation to this problem: LARGE(IF(OR($C:$C=$D3;$J:$J;$D3);$A:$A;"");C16)

    Can't get the formula above to work, can anyone see my mistake? Trying to return largest value from A:A, if cell D3 matches C:C or J:J.
    A:A is column 1,2,3,4,5,6
    C:C is A,B,D,B,D,A
    J:J is B,D,A,D,A,B

    So if I have B in cell D3 I would like formula return 6,4,2,1 (these are ofcourse in different cells,

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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