+ Reply to Thread
Results 1 to 10 of 10

What function to use

  1. #1
    Registered User
    Join Date
    10-26-2006
    Posts
    7

    What function to use

    Hi

    I would like to search across a number of rows in a worksheet and then match against two columns.

    e.g.

    Column B Column C

    test 10


    I would like the function to match against all rows that match against "test" in Column B and then work out which cell in Column C has the highest value

    I have looked in excel help but it I cannot find anything that shows me an example of what I am trying to do

    I would appreciate any help on this

    Thanks

  2. #2
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211
    Quote Originally Posted by noviceexcel
    Hi

    I would like to search across a number of rows in a worksheet and then match against two columns.

    e.g.

    Column B Column C

    test 10


    I would like the function to match against all rows that match against "test" in Column B and then work out which cell in Column C has the highest value

    I have looked in excel help but it I cannot find anything that shows me an example of what I am trying to do

    I would appreciate any help on this

    Thanks
    =MAX(IF(A2:A9="test",B2:B9))

    ctrl+shift+enter (not just enter)

  3. #3
    Registered User
    Join Date
    10-26-2006
    Posts
    7
    Thanks very much for the answer. That works great.

    How can i update this formula to ignore any cells that are blank

    Thanks

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Did you enter with Ctrl + shift + enter

    If your not sure how to use an array try this non array formula

    =SUMPRODUCT(MAX(--(A2:A9="TEST")*(--(B2:B9))))

    Change ranges in Col A and B as required

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Registered User
    Join Date
    10-26-2006
    Posts
    7
    Thanks

    I did add it as an array using ctrl shift & enter but i want the formula to ignore blank cells. Currently if the cells are blank it returns a value of 0. I would like the formula to be ignored if the cells are blank

    Thanks again

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Argh.

    You mean if there are no entries you want the cell with the formula to be blank

    Try

    =IF(SUMPRODUCT(MAX(--(A2:A9="TEST")*(--(B2:B9))))=0,"",SUMPRODUCT(MAX(--(A2:A9="TEST")*(--(B2:B9)))))

    Or

    use the formula originally provided and goto > tools > options > View and untick Zero values

    VBA Noob

  7. #7
    Registered User
    Join Date
    11-13-2006
    Posts
    13
    what does ctrl-shift-enter do?

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

  9. #9
    Registered User
    Join Date
    11-13-2006
    Posts
    13
    Been playing with it for the past half hour and figured out what it does. Thanks for the links though! I just bookmarked them!

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No Problem

    VBA Noob

+ 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