+ Reply to Thread
Results 1 to 6 of 6

return MAX based on criteria

  1. #1
    Registered User
    Join Date
    02-08-2007
    Posts
    17

    return MAX based on criteria

    hi i have a spreadsheet like the following

    A B C
    Country Revenue Month
    1 UK 10 Jan
    2 France 20 Jan
    3 US 30 Jan
    4 UK 25 Feb
    5 US 35 Feb
    6 France 5 Jan

    and so on...

    So where country = UK, France or US I want to retrieve the MAX revenue from all months and which month it was in.

    Eg UK max revenue was in Feb of 25.

    I am not sure how to apply the max formula with criteria. Is there any way to do this?

    Thanks in advance!
    Last edited by oldchippy; 11-09-2008 at 12:14 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Assuming your table, excluding headers, is in A2:C7

    IF you Enter UK in F2, then to get Max, in G2 enter: =MAX(IF(A2:A7=F2,B2:B7))

    to get Month where Max occurs: =INDEX(C2:C7,MATCH(1,(A2:A7=F2)*(B2:B7=G2),0))

    where G2 contains first formula result.

    Both formulas are array formulas and must be confirmed with CTRL+SHIFT+ENTER not just ENTER You will see { } brackets appear around them.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    May be something like this?
    Attached Files Attached Files
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by oldchippy
    Hi,

    May be something like this?

    When I select "France" from your drop down I still get "Feb" as month containing max when it should be "Jan"

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Quote Originally Posted by NBVC
    When I select "France" from your drop down I still get "Feb" as month containing max when it should be "Jan"
    Well spotted NBVC - there only room for one Eagle Eye

    anoushka please change H4 to

    =INDEX(Month,MATCH(1,(Country=F4)*(Revenue=G4),0))

    Entered as Ctrl+Shift+Enter

  6. #6
    Registered User
    Join Date
    02-08-2007
    Posts
    17
    thanks for the prompt response - works perfectly!!

+ 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