+ Reply to Thread
Results 1 to 7 of 7

Max If function not using criteria

  1. #1
    Forum Contributor
    Join Date
    05-31-2013
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2010
    Posts
    164

    Max If function not using criteria

    Hello all!

    I'm trying to write a formula that will find the max value in a column based on two criteria, and month and the Fiscal Year. I have the full date typed out in column A, and then formulas in columns B and R to pull the Month and Fiscal Year respectively.

    The data I want to find the Max of is in column P. What I have so far is....
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Essentially, here I want it to find the max value for July of 2013. Yet, this returns a negative value. I have toyed around with many different variations of this, even forgoing referencing columns B and R altogether by using the following...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    , but this only returns the max in my entire range, not the condensed criteria driven version.

    I've attached a spreadsheet with a snapshot of what I am working with, but my full list has over 5000 entries. Test2.xlsx

    Thanks in advance.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Max If function not using criteria

    Try this

    =MAX(IF((B:B=7)*(R:R=2013),P:P))

    I would also recommend to set ranges for better performance.

    ..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.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Max If function not using criteria

    In which cell do you plan on implementing this formula?

  4. #4
    Forum Contributor
    Join Date
    05-31-2013
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: Max If function not using criteria

    AlKey - When I tried your solution in the Test doc that I uploaded I got a value of 0, and when I tried it in my intended file it gave me a REF error.

    mcmahobt - I actually intend this cell to be on a different sheet

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Max If function not using criteria

    Quote Originally Posted by Jietoh View Post
    AlKey - When I tried your solution in the Test doc that I uploaded I got a value of 0, and when I tried it in my intended file it gave me a REF error.

    mcmahobt - I actually intend this cell to be on a different sheet
    Did you use CTRL+SHIFT+ENTER to enter formula?. Also, make sure that your criteria in B:B and R:R are actually numbers and not text.
    If you still have problems please upload a sample spreadsheet.

  6. #6
    Forum Contributor
    Join Date
    05-31-2013
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: Max If function not using criteria

    AlKey - I did CSE the formula. However, I continued tweaking it, and finally go it to work this morning.

    However, now I'm having another problem. The original goal (which I did not post about) was to write a formula that would display the account # of the highest single cost during a given period (in my example July 2013). After I got the above code to work, I began on the second part. I finally got the following to work on the same sheet as the data. (This formula is entered as a CSE).
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    However, when I take the same formula and move it to another worksheet and adjust the cell references I get a value of 0.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Again, this code is entered as a CSE value.

    Any ideas why its not working. The only thing that changed was moving it to a new sheet, and the updated cell references should have accounted for that.

  7. #7
    Forum Contributor
    Join Date
    05-31-2013
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: Max If function not using criteria

    I found the issue.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I forgot to reference this piece back to the other worksheet.

    Thanks for your help.

+ 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. Multiple Criteria Function along with Count function
    By Joseph Wee in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-23-2013, 12:51 AM
  2. Using IF function with mutilple criteria in combination with MID function
    By ryguy104gt in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-21-2013, 06:03 PM
  3. [SOLVED] Which function to use to sum with criteria?
    By jodieduncan in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-25-2012, 08:51 AM
  4. Match function no accepting a function as its criteria
    By Jon_Torbitt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-16-2012, 10:37 AM
  5. Need help to change multiple criteria from if function to Case function.
    By indkitty in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-29-2012, 10:42 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