+ Reply to Thread
Results 1 to 10 of 10

lookup value conditionally in 3 columns

  1. #1
    Forum Contributor
    Join Date
    12-13-2013
    Location
    Calgary,AB,Canada
    MS-Off Ver
    2016,O365
    Posts
    236

    Cool lookup value conditionally in 3 columns

    Hi, could you please help to answer following question regarding value lookup ? (please use function and formula only) thanks !!!

    1. the maximum value of item A in 2014 ( 318)
    2. the minimum value of item B in 2014 ( 2)


    Source data: A1:C15 (including header)
    For the same item, the Value doesn't have duplicate number.

    ITEM YEAR VALUE
    A 2013 10
    A 2014 1
    A 2014 115
    A 2014 215
    A 2014 21
    B 2014 11
    B 2014 3
    B 2014 34
    B 2014 2
    C 2014 3
    C 2014 8
    C 2014 6
    A 2014 318
    A 2014 12
    Last edited by CAABYYC; 01-07-2016 at 11:21 AM.

  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
    30,860

    Re: lookup value conditionally in 3 columns

    Try

    =MAX(IF(($A$2:$A$15="A")*($B$2:$B$15=2014),$C$2:$C$15))

    =MIN(IF(($A$2:$A$15="B")*($B$2:$B$15=2014),$C$2:$C$15))

    Enter both with Ctrl+Shift+Enter

  3. #3
    Forum Contributor
    Join Date
    12-13-2013
    Location
    Calgary,AB,Canada
    MS-Off Ver
    2016,O365
    Posts
    236

    Re: lookup value conditionally in 3 columns

    Thanks, John, except the value, I also want to see the "row#" of matched value. example, if I want to use a helper column at the right side of source data.

    1. the maximum value of item A in 2014 ( 318) --- row (14)
    2. the minimum value of item B in 2014 ( 2) ----row(12)

  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
    30,860

    Re: lookup value conditionally in 3 columns

    =MATCH(LARGE(IF(($A$2:$A$15="A")*($B$2:$B$15=2014),$C$2:$C$15),1),$C$2:$C$15,0)+1

    =MATCH(SMALL(IF(($A$2:$A$15="B")*($B$2:$B$15=2014),$C$2:$C$15),1),C2:C15,0)+1

    Entered with Ctrl+Shift+Enter
    Last edited by JohnTopley; 01-07-2016 at 11:55 AM.

  5. #5
    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
    30,860

    Re: lookup value conditionally in 3 columns

    be better

    =MATCH(LARGE(IF(($A$1:$A$15="A")*($B$1:$B$15=2014),$C$1:$C$15),1),$C$1:$C$15,0)

    =MATCH(SMALL(IF(($A$1:$A$15="B")*($B$1:$B$15=2014),$C$1:$C$15),1),$C$1:$C$15,0)

  6. #6
    Forum Contributor
    Join Date
    12-13-2013
    Location
    Calgary,AB,Canada
    MS-Off Ver
    2016,O365
    Posts
    236

    Re: lookup value conditionally in 3 columns

    Thank you so much, John

  7. #7
    Forum Contributor
    Join Date
    12-13-2013
    Location
    Calgary,AB,Canada
    MS-Off Ver
    2016,O365
    Posts
    236

    Re: lookup value conditionally in 3 columns

    Hi,John,
    after quick test, minor error was found in your formula to get row#.

    as what I said in the note for example database, "For the same item, the Value doesn't have duplicate number." that means same value# could be found in column C but this was not shown in example.
    if you change the "11" to "318" in "B 2014 11" at row 7, following 2 formula will get the row# for B instead of A. could you pls take a look again??


    =MATCH(LARGE(IF(($A$2:$A$15="A")*($B$2:$B$15=2014),$C$2:$C$15),1),$C$2:$C$15,0)+1
    =MATCH(LARGE(IF(($A$1:$A$15="A")*($B$1:$B$15=2014),$C$1:$C$15),1),$C$1:$C$15,0)

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

    Re: lookup value conditionally in 3 columns

    Use these array formula:
    Please Login or Register  to view this content.
    Change MAX to MIN
    Please Login or Register  to view this content.

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Last edited by bebo021999; 01-07-2016 at 12:41 PM. Reason: Change "A" to "B"
    Quang PT

  9. #9
    Forum Contributor
    Join Date
    12-13-2013
    Location
    Calgary,AB,Canada
    MS-Off Ver
    2016,O365
    Posts
    236

    Re: lookup value conditionally in 3 columns

    that works and thanks

    cảm ơn bạn đã giúp đỡ



    Quote Originally Posted by bebo021999 View Post
    Use these array formula:
    Please Login or Register  to view this content.
    Change MAX to MIN
    Please Login or Register  to view this content.

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

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

    Re: lookup value conditionally in 3 columns

    You are welcome.

+ 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. How to get 2 columns conditionally formatted against each other.
    By Nimmy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-08-2013, 05:03 AM
  2. conditionally deleting columns
    By aRKaycreative in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2011, 06:43 AM
  3. Conditionally Hide Columns
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 03-23-2010, 01:44 PM
  4. Conditionally lookup part of small list.
    By Jo-Jo in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 11-25-2009, 10:00 PM
  5. Delete Columns Conditionally
    By donnydorko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2009, 06:38 PM
  6. Replies: 0
    Last Post: 07-09-2009, 05:29 PM
  7. Conditionally format columns
    By aias in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2008, 01:10 AM
  8. [SOLVED] count conditionally across two columns?
    By gpoky in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-05-2005, 01:10 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