+ Reply to Thread
Results 1 to 6 of 6

Max if

  1. #1
    Registered User
    Join Date
    12-15-2008
    Location
    Singapore
    Posts
    38

    Max if

    I'm not sure if somebody had asked before, but I would like to get the maximum value based on certain condition.

    Col C = name
    Col J = amount
    Col K = maximum amount by same name

    For example, C1=C2=Tom, C3=C4=Jerry, J1=1, J2=2, J3=3, J4=4, what is the (array) formula for col K if I want the result: K1=K2=2, K3=K4=4?

    Thanks!

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    sounds like homework ... but

    =MAX(IF($C$1:$C$4=$C1,$J$1:$J$4))

    confirmed with CTRL + SHIFT + ENTER

  3. #3
    Registered User
    Join Date
    12-15-2008
    Location
    Singapore
    Posts
    38
    Quote Originally Posted by DonkeyOte View Post
    sounds like homework ... but

    =MAX(IF($C$1:$C$4=$C1,$J$1:$J$4))

    confirmed with CTRL + SHIFT + ENTER
    Thanks, it works for cell K1, but not K2 onwards. Each cell in col K is still comparing the value in col C to C1 instead of the respective rows.

    Btw it isn't homework. lol

  4. #4
    Registered User
    Join Date
    12-15-2008
    Location
    Singapore
    Posts
    38
    I am quite certain that your proposed solution works, after googling and reading other posts. Is there something wrong with my Excel? I'm using Excel 2003 SP3.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    I can only presume you applied the formula across the entire range (of K) simultaneously.

    Clear the range in which the array is present - re-enter the formula but only for the first row and set the array -- once the array is set (encased within { }) copy and paste the formula over the remaining rows - in turn the relative references will update accordingly.

  6. #6
    Registered User
    Join Date
    12-15-2008
    Location
    Singapore
    Posts
    38
    Thanks Donkey for your help! Your guess was right! Heehee

    Problem solved!

+ 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