+ Reply to Thread
Results 1 to 8 of 8

Max If Function across several Sheets

  1. #1
    Registered User
    Join Date
    10-22-2018
    Location
    Rome, Italy
    MS-Off Ver
    365
    Posts
    5

    Question Max If Function across several Sheets

    Hi All,

    I am trying to apply a max if function across several sheets using named range but it doesn't work.

    I would like to retrieve the latest date by product name and the formula I am using is:

    Please Login or Register  to view this content.
    with Weeks being a named range.

    Thank you for letting me know what's wrong with this formula
    Attached Files Attached Files
    Last edited by KurtCara; 03-21-2022 at 09:13 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Max If Function across several Sheets

    Change your Named Range to:

    =TRANSPOSE(Master!$G$1:$G$3)

    Then use:

    =IFERROR(1/(1/MAX(IF(T(OFFSET(INDIRECT("'"&Weeks&"'!A2:A30"),ROW($1:$30)-1,))=A2,N(OFFSET(INDIRECT("'"&Weeks&"'!B2:B30"),ROW($1:$30)-1,))))),"Not Found")

    You need to:

    1. Adjust the bits in RED to be sensible and future-proof

    2. Ensure that the number of rows covered by ROW is at least equal to the number of rows covered by the INDIRECT functions.

    3. Ensure that you do not go mad and use whole column references... it ill get slow.

    4. Answer this Q:

    There >>>may<<< be a non-volatile alternative. In your REAL data, roughly how many rows of raw data per sheet and how many sheets???
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Max If Function across several Sheets

    perhaps:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Max If Function across several Sheets

    I have a mental block about MAX-MAXIFS. I NEVER think about it and always wind up with a more long winded formula.

  5. #5
    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 Function across several Sheets

    If the limitations re string length are not an issue, and assuming the sheets to be interrogated are consecutive and well-ordered, with 365 we also have the option of circumventing the traditional volatile set-up for such 3D scenarios, viz:

    =IFERROR(MAX(FILTERXML("<a><b>"&TEXTJOIN("</b><b>",,Week1:Week3!A$2:B$9)&"</b></a>","//b[preceding::*[1]="""&A2&"""]")),"Not Found")

    Regards
    Click * below if this answer helped

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

  6. #6
    Registered User
    Join Date
    10-22-2018
    Location
    Rome, Italy
    MS-Off Ver
    365
    Posts
    5

    Re: Max If Function across several Sheets

    Hi Glen, thank you very much. THere are about 45 rows and 12 sheets in total. Do you think this formula can be used? When you refer to a non volatile alternative, what do you mean?

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Max If Function across several Sheets

    My idea would not have worked... but with only about 600 rows in total... XOR LX's solution should ve just fine!! As long as there are < 32767 characters in the whole lot combined try his solution.

    Volatile = recalculates every time anything changes. With BIG data (unlike yours) it can get laggy. OFFSET & INDIRECT are both volatile. Avoid them if you can...

  8. #8
    Registered User
    Join Date
    10-22-2018
    Location
    Rome, Italy
    MS-Off Ver
    365
    Posts
    5

    Re: Max If Function across several Sheets

    Hi Xor,

    thank you for your help with this formula. However, in my real file this formula fails and returns the #VALUE! error.

    If I check the error through the Error checking functionality of Excel, the error shows me the following:

    Attachment 775067

    When I then evaluate the calculations, this is the errors I get:

    Attachment 775068
    Attachment 775069

    I actually understand what's annoying this formula. In the real file, column B and C of the Weeks sheets contain some free text: when I this text is removed the formula works, when the text is there the #VALUE! error comes up.

    2 Questions:
    - How can I make sure that this formula doesn't get annoyed by the free text in column B and C? The length of this text may vary from cell to cell and is not fixed.
    - In my real file, the Weeks sheets contain 2 columns with a date: column D and F. How can I make sure that the formula only gives me the date located in column F?

    Thanks a lot in advance
    Last edited by KurtCara; 04-01-2022 at 06:50 AM.

+ 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. COUNTUNIQUE Function in Google Sheets; Excel lacks a direct counterpart to this function?
    By PivotTablePSHomage in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2018, 05:27 AM
  2. Address function with Sum Sheets function
    By nathan68 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-25-2016, 03:09 PM
  3. [SOLVED] Using a nested IF Function and AND function on 2 sheets?
    By heresteve2 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-29-2014, 02:14 PM
  4. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  5. [SOLVED] IF Function referencing IsNumber, Match, Left function on separate sheets
    By Touch9713 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-12-2013, 10:09 PM
  6. Replies: 1
    Last Post: 09-24-2011, 01:46 AM
  7. VBA Sheets Function
    By paullayton in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-21-2007, 09:36 PM

Tags for this Thread

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