+ Reply to Thread
Results 1 to 9 of 9

Max If statement not working across multiple sheets

  1. #1
    Registered User
    Join Date
    10-25-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Max If statement not working across multiple sheets

    {=MAX(IF('2010:2014'!B:B=A2,'2010:2014'!C:C))}

    I am entering with CTRL-Shift-Enter and this formula isn't working.

    If I remove the IF statement this formula works. With it, however, will give me a #REF error. But I need the IF because I'm trying to determine the MAX of a specific criteria over time.

    I've attached my spreadsheet and you can find this formula in K7 of the 'Scoring Records' tab.

    One other question... the MAX formula allows for multiple criteria but is there a way to put it without entering the entire formula a second (or third) time beyond a comma?

    I would like to remove the ALL tab, that's why I'm trying to do this across multiple sheets.
    Attached Files Attached Files
    Last edited by Robmeister89; 10-25-2013 at 11:27 AM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Max If statement not working across multiple sheets

    Hi and welcome to the forum,

    3D referencing like that is not easy!

    Try this array formula in K2 and copy down as required:

    =SUM(IF(IF(SUBTOTAL(3,OFFSET(INDIRECT(2010+ROW(INDIRECT("1:5"))-1&"!B2"),,,,)),T(OFFSET(INDIRECT(2010+ROW(INDIRECT("1:5"))-1&"!B2"),TRANSPOSE(ROW($1:$200)),,,)))=A2,IF(SUBTOTAL(3,OFFSET(INDIRECT(2010+ROW(INDIRECT("1:5"))-1&"!C2"),,,,)),N(OFFSET(INDIRECT(2010+ROW(INDIRECT("1:5"))-1&"!C2"),TRANSPOSE(ROW($1:$200)),,,)))))

    Regards
    Last edited by XOR LX; 10-26-2013 at 01:50 AM.
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    10-25-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Max If statement not working across multiple sheets

    Well that definitely worked for that column... I'm assuming there is no easier way?

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Max If statement not working across multiple sheets

    Working with 3D range references with worksheet formulas is very limited and not at all simple.

    If you're not happy with that solution then you can always implement some VBA.

    Regards

  5. #5
    Registered User
    Join Date
    10-25-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Max If statement not working across multiple sheets

    Quote Originally Posted by XOR LX View Post
    Working with 3D range references with worksheet formulas is very limited and not at all simple.

    If you're not happy with that solution then you can always implement some VBA.

    Regards
    I wouldn't say I'm not happy with it. I would have never figured that one out. But I like simplicity and was hoping that the formula would be simple. If not, I have it figured out as long as I have a tab featuring all years on one tab.

    I do appreciate the help.

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Max If statement not working across multiple sheets

    Sure. I understand, and it's generally better for analysis to have all the data in one tab anyway.

    I just realised as well that you wanted the max, not the sum, so just change SUM to MAX in the formula I gave you.

    Regards

  7. #7
    Registered User
    Join Date
    10-25-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Max If statement not working across multiple sheets

    Quote Originally Posted by XOR LX View Post
    Sure. I understand, and it's generally better for analysis to have all the data in one tab anyway.

    I just realised as well that you wanted the max, not the sum, so just change SUM to MAX in the formula I gave you.

    Regards
    Yeah I caught that. Thanks again for your time.

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Max If statement not working across multiple sheets

    You're welcome.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Max If statement not working across multiple sheets

    I didn't look at your file. I have a 50kb download limit!

    Assuming column B in your sheets contain TEXT and the criteria cell A2 also contains TEXT...

    Create this named expression:

    Goto the Formulas tab>Define Name
    Name: Sheets
    Refers to: ={2010,2011,2012,2013,2014}
    OK out

    Then, this array formula**:

    =MAX(IF(T(OFFSET(INDIRECT("'"&Sheets&"'!B2:B10"),ROW(B2:B10)-ROW(B2),))=A2,N(OFFSET(INDIRECT("'"&Sheets&"'!C2:C10"),ROW(C2:C10)-ROW(C2),))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    You should avoid using entire columns as range references in array formulas. Use smaller specific ranges.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. [SOLVED] Multiple IF Statement not working.
    By Stahlfeder in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-17-2012, 05:00 PM
  2. Working with multiple sheets
    By Flying1Solo in forum Excel General
    Replies: 6
    Last Post: 09-24-2008, 11:11 AM
  3. Working with multiple sheets
    By angus in forum Excel General
    Replies: 1
    Last Post: 05-15-2007, 12:03 PM
  4. Multiple Conditional @IF Statement Not Working?
    By crwiseman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-25-2006, 02:31 PM
  5. If statement - Multiple Sheets
    By STEVEB in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-01-2006, 12:25 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