+ Reply to Thread
Results 1 to 9 of 9

Problem with MINIFS and MAXIFS

  1. #1
    Registered User
    Join Date
    10-21-2019
    Location
    france
    MS-Off Ver
    (16.0.11328.20420) 64 bit
    Posts
    6

    Problem with MINIFS and MAXIFS

    Hello, I have a file that groups similar data, the duplicated count is the number of data in each group, I have to assign the golden ID (X) in each group: There are two conditions, the data that has the smallest type is the golden ID, example if we have two data that have type2 and type4, the data that has the type2 is the golden, but there is another condition if we have two data that have the same type, the data that will be the golden is the one with the largest number. I tried to write a code VBA and formula that shows the golden ID but in group C for example, we see that it affects the golden ID to data which has the number 20 but I want that the golden will be the next data that has the number 40. here is what my file looks like
    Attached Images Attached Images

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

    Re: Problem with MINIFS and MAXIFS

    based on your sample data, if we assume it's stored in A1:E11 (with row being headers), one option:

    F2:
    =REPT("X",IFERROR(AGGREGATE(14,6,$E$2:$E$11/($A$2:$A$11=$A2)/(COUNTIFS($A$2:$A$11,$A2,$D$2:$D$11,"<"&$D2)=0),1)=$E2,0))
    copied down

    it's not particularly efficient though.

  3. #3
    Registered User
    Join Date
    10-21-2019
    Location
    france
    MS-Off Ver
    (16.0.11328.20420) 64 bit
    Posts
    6

    Re: Problem with MINIFS and MAXIFS

    Thank you for your answer, your formula works fine but it affects the Golden X to all types 1, I want only one Golden X per group.
    I also want to know please what it means 14 and 6 at the beginning of your formula.

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

    Re: Problem with MINIFS and MAXIFS

    Could you attach a sample file which illustrates a slightly wider dataset -- to do this click Go Advanced -> Manage Attachments, and upload from there (the paperclip icon does not work).

    The formula should assign an "X" for the given ID where current Type and Value match the smallest and largest values for each - if you have multiple instances of the smallest Type and greatest Value for a given ID you will get multiple Xs, but this can be adjusted:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    if the above is not working for you please post a sample file to illustrate -- to do this click GoAdvanced -> Manage Attachments, and upload the file from there (the paperclip icon does not work).

    edit: disregard the above, it does not work for your requirement.

    Quote Originally Posted by mimich
    I also want to know please what it means 14 and 6 at the beginning of your formula.
    the 14 in the above tells AGGREGATE to use LARGE function on resulting array of values
    the 6 in the above tells AGGREGATE to ignore Errors that appear in the resulting array of values (we divide the value by the Booleans to generate errors - e.g. 2/FALSE --> #DIV/0!)
    the 1 in the above is used as "k" for use with the LARGE -- so it returns the biggest number.
    Last edited by XLent; 10-21-2019 at 12:24 PM.

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

    Re: Problem with MINIFS and MAXIFS

    apologies I had a typo in my prior suggestion(s), perhaps the below will work for you?

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

  6. #6
    Registered User
    Join Date
    10-21-2019
    Location
    france
    MS-Off Ver
    (16.0.11328.20420) 64 bit
    Posts
    6

    Re: Problem with MINIFS and MAXIFS

    I have joined the file, in the golden column this is the result I want to get. thank you
    Attached Files Attached Files

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

    Re: Problem with MINIFS and MAXIFS

    OK; I think the revised formula in my previous post [#5] should generate expected results?

    Apologies for confusion caused by my earlier mistake.

  8. #8
    Registered User
    Join Date
    10-21-2019
    Location
    france
    MS-Off Ver
    (16.0.11328.20420) 64 bit
    Posts
    6

    Re: Problem with MINIFS and MAXIFS

    Thank you for your time. But the golden X appears only for the first group even if I copied down ?!!

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

    Re: Problem with MINIFS and MAXIFS

    see attached, note I have switched to use structured references per your use of the Table object
    Attached Files Attached Files

+ 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. MinIFS() for older versions of excel help.
    By MarvinP in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-31-2020, 01:09 AM
  2. Replies: 3
    Last Post: 07-24-2019, 11:59 PM
  3. Min dmin minif minifs min+if
    By Pawnar in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-06-2019, 06:51 AM
  4. [SOLVED] MAXIFS and MINIFS not available
    By TFiske in forum Excel General
    Replies: 7
    Last Post: 05-08-2019, 11:27 PM
  5. MAXIFS Problem - Non-Adjacent Range Name
    By willyt19712 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-24-2019, 06:02 PM
  6. Excel Help MINIFS
    By wolf767 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2015, 06:55 AM
  7. Minifs, maxifs, averageifs, medianifs, coeffvarifs
    By qwertyjjj in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-30-2014, 07:48 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