+ Reply to Thread
Results 1 to 16 of 16

Formula to count MIN of column with a condition

  1. #1
    Registered User
    Join Date
    10-12-2008
    Location
    Melbourne, Australia
    Posts
    55

    Formula to count MIN of column with a condition

    Hello again,

    I have a formula that tests the minimum time in a column. If the time is the minimum it gets a PB (Personal Best) notation. My problem is once a season there is a competion that needs to be recorded on the worksheet however I do not want this time for this competion counted in the MIN test or to get a PB allocated. I have worked out how to ignore the PB but I cannot get the MIN test to work properly. Dates of comp are in Col B, data (times) in Col C and formula for PB's in Col D. When a cell in Col B (Dates of comp) = Region I want the MIN test to ignore the value in the adjacent cell in Col C.

    Please Login or Register  to view this content.
    This formula has been filled down from D10 to D29. Region (condition) date can be anywhere in B10 to B29.

    Any suggestions.

    Thanks

    RunHard
    Last edited by RunHard; 03-15-2009 at 05:50 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formula to count MIN of column with a condition

    That's a lot of hard to picture explanation...couldn't a workbook show us this much more clearly?

    Post one up and highlight what you want, show the desired result and we'll try adjusting the raw data with real formulas to accommodate.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-12-2008
    Location
    Melbourne, Australia
    Posts
    55

    Re: Formula to count MIN of column with a condition

    Will do. Its been a while so I will have to refresh on how to post a worksheet.

    Bolter

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Formula to count MIN of column with a condition

    Your post does not comply with Rule 5 of our Forum RULES. We have Seven question forums: Miscellaneous, General, Programming, Worksheet Functions, Charting, Excel 2007 Help and New Users. Please choose the appropriate forum, and post your question in ONLY one forum.

    Moved to Excel Functions
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formula to count MIN of column with a condition

    Go advanced > paperclip icon.

  6. #6
    Registered User
    Join Date
    10-12-2008
    Location
    Melbourne, Australia
    Posts
    55

    Re: Formula to count MIN of column with a condition

    Sheet attached sample of the worksheet.

    So what I am after is for the formula to ignore data in C15 (Adjacent to B15 = "REGION". This formula should then recognise C16 as a PB (Next best time other than REGION day). The region competition day date changes every season so it will not always be in B15. The formula I am after will somehow recognise "Region" in Col B and ignore data in the cell adjacent in Col C.


    RunHard
    Attached Files Attached Files

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formula to count MIN of column with a condition

    Now show us the same chart with the answers you're looking for, I still have no idea what you're asking for, where, even with all the "how" you've offered. Simple Before/After is so much clearer.

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to count MIN of column with a condition

    If D10 were to equal "PB" which I'm guessing it should do then you could use:

    D11:
    =IF(OR(B11="REGION",C11=""),"",LOOKUP(REPT("z",255),CHOOSE({1,2},"",REPT("PB",C11<LOOKUP(2,1/(D$10:D10="PB"),C$10:C10)))))
    copied down as required.

    Others may suggest a MIN(IF( array... which given volume of data may not be too bad...but I would still opt for above type approach myself.
    Last edited by DonkeyOte; 03-15-2009 at 04:39 AM.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formula to count MIN of column with a condition

    Also, we can simplify your existing formula a wee bit, too. In D11 and copied down:

    =IF(AND(B11<>"REGION",ISNUMBER(C11)),IF(C11<(MIN(C$10:C10)),"PB",""),"")

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to count MIN of column with a condition

    JB, the formula in D is the one that needs to be edited I believe to account for the fact that time accompanying "REGION" to be discounted when establishing PB's... for this a MIN(IF array could be used but I based my non-array on the fact that you don't need to find the MIN technically... all you need do is find the last instance of PB in the preceding rows as this is the current PB (ie the MIN value)

  11. #11
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formula to count MIN of column with a condition

    Yeah, I don't follow any of that at all. Your formula just gives me FALSE all the way down the column D when I use it, too. I'd like to hear from the OP exactly what the answers should look like.

  12. #12
    Registered User
    Join Date
    10-12-2008
    Location
    Melbourne, Australia
    Posts
    55

    Re: Formula to count MIN of column with a condition

    Thanks guys for the reply.

    JB, attached is the result I am after in the worksheet. C16 is where I want the formula to recognise it as a PB ignoring C15 even though it is a better time.

    DonkeyOte, I tried that formula and it did not pick up any PB's when I entered data. C10 is the first comp time for the season and anything after this which is a better time will need to be recognised be a PB with the exception of Region day.

    Thanks for your efforts.

    RunHard
    Attached Files Attached Files

  13. #13
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to count MIN of column with a condition

    JB, not quite sure how you've managed to get it to return FALSE given if inserted correctly it would only ever return a Null or "PB". As I mentioned all would be blank unless D10 (first time) were assigned as "PB" manually (or via formula).

    I've attached a sample to show in operation to avoid further confusion for OP.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    10-12-2008
    Location
    Melbourne, Australia
    Posts
    55

    Re: Formula to count MIN of column with a condition

    DonkeyOte,

    I see what you are saying and it didn't work on my worksheet due to C10 not being allocated a PB. As mentioned in a previous post the first time of the season is not a PB, everything after that, that is a better time is a PB. An athlete might not compete in the first comp day therefore this would throw out the formula. His first comp day might be C13 and then anything better after this would be a PB. Hope I am making sense.


    RunHard

  15. #15
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to count MIN of column with a condition

    You could as I say use an array

    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    10-12-2008
    Location
    Melbourne, Australia
    Posts
    55

    Re: Formula to count MIN of column with a condition

    DonkeyOte,

    Thank you very much, your last suggestion works perfectly. Last piece of the puzzle.

    Very Grateful

    RunHard

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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