+ Reply to Thread
Results 1 to 6 of 6

Need help to find the min value across dates and another variable

  1. #1
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Need help to find the min value across dates and another variable

    Hi

    I am looking to output the min value based on dates and also one other variable (named RN).

    For example, multiple values will exist across dates and RN, I just need to pull out the min value. If there is only one RN, then I need that value. Also, if there are only 2 or 3 values and they are the same, I don't want to return anything.

    I have explained in the attached.

    Hoping someone can help me with this?
    Attached Files Attached Files

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Need help to find the min value across dates and another variable

    I suppose the table is sorted.
    Try with a helper column
    In E2 use the following formula and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In F2 use the formula and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    You can hide the column E.

    See the file
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help to find the min value across dates and another variable

    perfect, thanks Jose!

    I have one other question.

    In Col L, I have the finishing position (1st, 2nd, 3rd or 4th).

    If there is a "1st" against one of the values for the day, how can I skip the values and go straight to the next day?

    I have explained in the attached.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help to find the min value across dates and another variable

    I have managed to create a loop but unfortunately it is still not producing the required results? Does anyone have any ideas?

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Need help to find the min value across dates and another variable

    Hi Jose,

    I have sorted the table and inputted these formulas, however I do not get all of the results.

    See attached on some sample data where I have highlighted in yellow the gaps.

    Are you able to assist me with this please?
    Attached Files Attached Files

  6. #6
    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,064

    Re: Need help to find the min value across dates and another variable

    Try this array formula in E2, copied down:

    =IF(COUNTIFS(A:A,A2,C:C,C2,D:D,D2)>1,"",IF(MIN(IF($A$2:$A$70=A2,IF($C$2:$C$70=C2,$D$2:$D$70)))=D2,D2,""))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    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

+ 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] VB Loop different variables and stop variable to find a new variable..
    By feroguz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2014, 04:54 PM
  2. [SOLVED] display weekly dates depending on two variable dates
    By alexander.small in forum Excel General
    Replies: 3
    Last Post: 05-22-2014, 11:30 AM
  3. Replies: 4
    Last Post: 03-06-2014, 07:49 PM
  4. [SOLVED] Object variable or With block variable not set error in Find
    By wintermelon in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-23-2013, 03:27 AM
  5. Replies: 6
    Last Post: 12-21-2012, 08:03 AM
  6. Replies: 1
    Last Post: 06-25-2012, 12:45 AM
  7. Find Method error: -Object variable with block set variable not set
    By bambino_32 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-02-2010, 01:18 AM

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