+ Reply to Thread
Results 1 to 6 of 6

Error using MATCH formula with LARGE and IF arguments

Hybrid View

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Error using MATCH formula with LARGE and IF arguments

    Hello all!

    I want my formula to yield the value associated to the top 3 highest values in a column when evaluating only certain rows.

    My best attempt does not yield something that makes sense:
    Formula: copy to clipboard
    =MATCH(IF(B2:B26="Consultants",LARGE(C2:C26,1),0),C2:C26,0)


    Using the example with the 3 projects below (project # are in column A), i would want the formula to:
    (1) Look only for "Consultants" costs in column B;
    (2) Find in column C the highest value associated to the "Consultants" rows;
    (3) Return the project number from column A as the result of the formula

    In this case the result i am looking for would be "2946".

    Example:
    A B C
    2946 Learning Door Project 10.5138
    2946 Hardware 0
    2946 Software 0
    2946 Internal Salaries 0
    2946 Consultants 10.5138
    2946 Consultants C Tfr from Opex 0
    2946 Consultants T Tfr from Opex 0
    2946 Intercos 0
    2946 Other 0
    2953 Q3 Q4 2012 Relations -1.2375
    2953 Hardware 0
    2953 Software 0
    2953 Internal Salaries 0
    2953 Consultants 0
    2953 Consultants C Tfr from Opex 0
    2953 Consultants T Tfr from Opex -1.2375
    2953 Intercos 0
    2953 Other 0
    2965 FE + SE Maintenance 1.6418
    2965 Hardware 0
    2965 Software 0
    2965 Internal Salaries 0
    2965 Consultants 1.6418
    2965 Consultants C Tfr from Opex 0
    2965 Consultants T Tfr from Opex 0
    2965 Intercos 0
    2965 Other 0

    Any help would be GREATLY appreciated! My spreadsheet has over a thousand projects...
    Thanks in advance for your inputs!
    CT

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Error using MATCH formula with LARGE and IF arguments

    CMTR,

    Welcome to the forum!
    Using your sample data, the formula should look like this:
    =INDEX(A2:A28,MATCH(MAX(INDEX((B2:B28="Consultants")*C2:C28,)),C2:C28,0))
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-09-2009
    Location
    Manchester,England
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    58

    Re: Error using MATCH formula with LARGE and IF arguments

    Try this

    Formula: copy to clipboard
    =IF(INDEX($A$2:$A$26,MATCH("Consultants*",$B$2:$B$26,0)),LARGE(C2:C26,1))


    The astrix is a wildcard as I wasn't sure if you test for Consultants C Tfr from Opex
    etc..

    Regards

  4. #4
    Registered User
    Join Date
    04-09-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Error using MATCH formula with LARGE and IF arguments

    Thanks Tigeravatar and Wagstaff! Much appreciated

    @Tigeravatar: your formula gave me the right project number (2946) but i am not sure of how i can modify it to find the top 3 highest projects? Shouldn't there be a LARGE somewhere so i could do a LARGE(C2:C26,1), LARGE(C2:C26,2) and LARGE(C2:C26,3) in 3 different cells?

    @Wagstaff: your formula worked but did not yield the project number as i was looking to get, it provided me with the highest value associated to the "Consultants" costs...

    Again, thanks for your inputs. Already helped me tons!
    CT

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Error using MATCH formula with LARGE and IF arguments

    CMTR,

    Just change the MAX for LARGE, like so (the red 1 what should change to 2 or 3):
    =INDEX($A$2:$A$28,MATCH(LARGE(INDEX(($B$2:$B$28="Consultants")*$C$2:$C$28,),1),$C$2:$C$28,0))
    Last edited by tigeravatar; 04-10-2013 at 10:41 AM. Reason: Made the X in Large(array,X) red

  6. #6
    Registered User
    Join Date
    04-09-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Error using MATCH formula with LARGE and IF arguments

    This works perfectly... thank you SO much! Saved me hours and hours for sure on this

+ 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