+ Reply to Thread
Results 1 to 11 of 11

Locate value using 2 criteria

  1. #1
    Registered User
    Join Date
    03-02-2015
    Location
    Hellas
    MS-Off Ver
    2010
    Posts
    36

    Locate value using 2 criteria

    Hi to everyone.

    I have an excel where in column C i have dates (7/1/2016, 6/1/2016, 5/1/2016, 4/1/2016,...etc), in column D i have currencies (USD,GBP, INR, ZAR, ..., etc.), and in column E the values.

    In a second sheet in A1 i have the date, in A2 the currency, so I need in A3 to bring the value searching from the first sheet.

    A1 7/1/2016
    A2 USD
    A3 ?


    Thanks in advance for your valuable help,
    Manos

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: Locate value using 2 criteria

    Try in A3

    =INDEX(Sheet1!E2:E100,MATCH(1,(A1=Sheet1!C2:C100)*(A2=Sheet1!D2:D100),0))

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: Locate value using 2 criteria

    Try in A3

    =INDEX(Sheet1!E2:E5,MATCH(1,(A1=Sheet1!C2:C5)*(A2=Sheet1!D2:D5),0))

    Enter with Ctrl+Shift+Enter

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: Locate value using 2 criteria

    Or

    =INDEX(Sheet1!E2:E5,AGGREGATE(15,6,ROW(A1:A5)/(Sheet1!C2:C5=A1)/(Sheet1!D2:D5=A2),ROW(A1)))

  5. #5
    Registered User
    Join Date
    03-02-2015
    Location
    Hellas
    MS-Off Ver
    2010
    Posts
    36

    Re: Locate value using 2 criteria

    Hi John,
    thank you for your help.

    The second criteria gives false. The Currency is repeated each day so i have 365 * USD, 365* BGN,.
    The first one is ok with the date.

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Locate value using 2 criteria

    here is another one
    =INDEX(Sheet1!$E$1:$E$4,MATCH(TRUE,INDEX(A1&A2=Sheet1!$C$1:$C$4&Sheet1!$D$1:$D$4,0),0))
    change the reference accordingly
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  7. #7
    Registered User
    Join Date
    03-02-2015
    Location
    Hellas
    MS-Off Ver
    2010
    Posts
    36

    Re: Locate value using 2 criteria

    That works fine.
    Thanks a lot.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: Locate value using 2 criteria

    Unless I misunderstand the format of your data, both work for me

    07/01/2016 USD 123
    07/01/2016 BGN 234


    With data as shown I get 123 a1=07/01/2016 and a2=USD

    or 234 with a2=BGN

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

    Re: Locate value using 2 criteria

    You would do better to look again at John's formula. Those concatenation array forms of index-match (Post 6) can be very slow if you have a lot of rows!!!
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  10. #10
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Locate value using 2 criteria

    you can use below as an another approach
    =VLOOKUP(A1&A2,CHOOSE({1,2},Sheet1!$C$1:$C$4&Sheet3!$D$1:$D$4,Sheet1!$E$1:$E$4),2,0)
    copy paste above then hold ctrl+shift together and then hit enter
    change reference accordingly

  11. #11
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Locate value using 2 criteria

    =MAX(INDEX((A1=Sheet1!C1:C4)*(A2=Sheet1!D1:D4)*(Sheet1!E1:E4),0))

    how about this one then

    in case of no duplicates
    =SUMIFS(Sheet1!E:E,Sheet1!C:C,A1,Sheet1!D:D,A2)
    Last edited by hemesh; 01-08-2016 at 06:04 AM.

+ 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. Locate a Cell based upon criteria
    By Stan in forum Excel General
    Replies: 1
    Last Post: 09-23-2005, 11:05 AM
  2. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  3. Locate max value of one column based on criteria in another colum
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 05:05 PM
  4. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 PM
  5. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  6. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  7. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  8. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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